- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to plot additional points on the top of a scatter plot in Matplotlib?
To plot additional points on the top of a scatter plot in matplotlib, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Make a list of x and y data points.
Create a scatter plot with x and y data points.
Plot the additional points with marker='*'
To display the figure, use show() method.
from matplotlib import pyplot as plt # Set the figure size plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True # List of data points x = [1, 2, 6, 4] y = [1, 5, 2, 3] # Scatter plot with x and y plt.scatter(x, y, c=x, cmap='hot') plt.plot([3, 4], [6, 7], marker='*', ls='none', ms=20) # Display the plot plt.show()
It will produce the following output −
- Plot scatter points on polar axis in Matplotlib
- Plot scatter points using plot method in Matplotlib
- Plot scatter points on 3d plot without axes and grids in Matplotlib
- How to annotate the points on a scatter plot with automatically placed arrows in Matplotlib?
- Connecting two points on a 3D scatter plot in Python and Matplotlib
- How to plot scatter points with increasing size of marker in Matplotlib?
- How do you directly overlay a scatter plot on top of a jpg image in Matplotlib?
- Plot scatter points on a 3D projection with varying marker size in Matplotlib
- How to animate a scatter plot in Matplotlib?
- How to plot scatter points in a 3D figure with a colorbar in Matplotlib?
- How to use different markers for different points in a Pylab scatter plot(Matplotlib)?
- How to show tick labels on top of a matplotlib plot?
- How to plot scatter masked points and add a line demarking masked regions in Matplotlib?
- How to plot blurred points in Matplotlib?
- Python Plotly – How to manually set the color of points in a scatter plot?