- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How to make a multicolored point in Matplotlib?
To make a multicolored point in matplotlib, we can take the following steps−
- Initialize two varuables, x and y.
- Use scatter method with x and y data points with green color having marker size 2000.
- Use scatter method with x and y data points with red color having marker size 1000.
- Use scatter method with x and y data points with blue color having marker size 500.
- Use scatter method with x and y data points with white color having marker size 10.
- To display the figure, use show() method.
Example
from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True x, y = 0, 0 plt.scatter(x, y, c='green', s=2000) plt.scatter(x, y, c='red', s=1000) plt.scatter(x, y, c='blue', s=500) plt.scatter(x, y, c='white', s=10) plt.show()
Output
- Related Articles
- Plot a multicolored line based on a condition in Python Matplotlib
- How to make a rug plot in Matplotlib?
- How to make a mosaic plot in Matplotlib?
- How to make a grouped boxplot graph in matplotlib?
- How to make a simple lollipop plot in Matplotlib?
- How to make axes transparent in Matplotlib?
- How to plot a point on 3D axes in Matplotlib?
- How to make a broken horizontal bar plot in Matplotlib?
- How to make the Parula colormap in Matplotlib?
- How to make joint bivariate distributions in Matplotlib?
- How to make Matplotlib scatterplots transparent as a group?
- How to center an annotation horizontally over a point in Matplotlib?
- How to make a quiver plot in polar coordinates using Matplotlib?
- How to make a heatmap square in Seaborn FacetGrid using Matplotlib?
- How to make a polygon radar (spider) chart in Python Matplotlib?

Advertisements