- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
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
Plotting scatter points with clover symbols in Matplotlib
To plot scatter points with clover symbols in Matplotlib, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Create x, y and z data points using numpy.
- Plot x, y and s using scatter() method.
- Set X and Y axes labels.
- Place a legend at the upper left of the plot.
- To display the figure, use show() method.
Example
import matplotlib.pyplot as plt import numpy as np plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True x = np.arange(0.0, 50.0, 2.0) y = x ** 1.3 + np.random.rand(*x.shape) * 30.0 s = np.random.rand(*x.shape) * 800 + 500 plt.scatter(x, y, s, c=x, alpha=0.5, marker=r'$\clubsuit$', label="Legend", cmap="plasma") plt.xlabel("X-Axis") plt.ylabel("Y-Axis") plt.legend(loc='upper left') plt.show()
Output
- Related Articles
- Plot scatter points on polar axis in Matplotlib
- Plot scatter points using plot method in Matplotlib
- How to plot scatter points with increasing size of marker in Matplotlib?
- Plot scatter points on a 3D projection with varying marker size in Matplotlib
- How to plot scatter points in a 3D figure with a colorbar in Matplotlib?
- How to annotate the points on a scatter plot with automatically placed arrows in Matplotlib?
- Adding a scatter of points to a boxplot using Matplotlib
- How to shade points in a scatter based on colormap in Matplotlib?
- Plot scatter points on 3d plot without axes and grids in Matplotlib
- Connecting two points on a 3D scatter plot in Python and Matplotlib
- Plotting points on the surface of a sphere in Python's Matplotlib
- How to use different markers for different points in a Pylab scatter plot(Matplotlib)?
- How to plot additional points on the top of a scatter plot in Matplotlib?
- Interactive plotting with Python Matplotlib via command line
- Python - Plotting scatter charts in excel sheet using XlsxWriter module

Advertisements