How to Create Scatter Plots in Python With Matplotlib
Learn how to draw scatter plots in Python with Matplotlib and Seaborn, encode extra variables with colour and size, and add a regression line.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
Learn how to draw scatter plots in Python with Matplotlib and Seaborn, encode extra variables with colour and size, and add a regression line.
Draw histograms in Python with Matplotlib, Seaborn and pandas, choose the right number of bins, and compare distributions with density and hue.
A practical guide to plotting in Python: line, bar, scatter, histogram, box and pie charts with Matplotlib, Seaborn and pandas, plus how to save them.
Seaborn is a high-level statistical layer on top of Matplotlib. Compare defaults, data handling and plot types, with code for both libraries.
Use NumPy and SciPy to analyse frequencies with the FFT, filter noise with Butterworth filters, find peaks, resample and plot spectrograms.
A practical guide to optimization in Python using scipy.optimize: minimize, constraints, linprog, curve_fit and global search, with runnable examples.
Solve a system of linear equations in Python with numpy.linalg.solve, and learn when to use lstsq, SciPy or SymPy instead of matrix inversion.
Use NumPy and SciPy for fast numerical work in Python: vectorised arrays, linear algebra, integration and optimisation, with tips on floating-point accuracy.
NumPy gives you fast N-dimensional arrays, and SciPy builds optimisation, statistics and signal tools on them. Learn how they differ and work together.
Convert grayscale images to binary in Python using global, Otsu and adaptive thresholding in OpenCV, plus a quick Pillow alternative.
Enhance images in Python with OpenCV and Pillow. Adjust brightness and contrast, apply CLAHE, denoise and sharpen using short runnable examples.
Segment images in Python using OpenCV methods like K-means, watershed and GrabCut, and a pretrained DeepLabV3 model for semantic masks.
Run a pre-trained YOLO or Faster R-CNN model in Python to get boxes, labels and scores for objects in an image or video, then tune thresholds.
Use dlib's HOG or CNN face detector in Python, add 68-point landmarks, and compare it with MediaPipe for speed and accuracy.
Load an image with OpenCV and run a Haar cascade or the YuNet neural detector to get face bounding boxes, with tuning tips and a webcam loop.
Read images with cv2.imread into NumPy arrays, then resize, crop, blur, threshold and detect edges. Mind the BGR channel order.
Open images with Pillow's Image.open, then resize, crop, rotate, filter and save them. Use NumPy or OpenCV for numeric and vision tasks.
Pillow is best for image I/O and basic editing, OpenCV for computer vision and video. See how they differ, how to convert between them and which to choose.
Animate a Python GUI by updating state each frame and scheduling the next one with Tkinter's after() method, without freezing the window.
Collect and validate user input in Tkinter with Entry, Text, Combobox and Checkbutton widgets, keyboard events and error messages, plus how to avoid freezing the window.