- 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
Set variable point size in Matplotlib
To set the variable point size in matplotlib, we can take the following steps−
- Initialize the coordinates of the point.
- Make a variable to store the point size.
- Plot the point using scatter method, with marker=o, color=red, s=point_size.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 xy = (3, 4) point_size = 100 plt.scatter(x=xy[0], y=xy[1], marker='o', c='red', s=point_size) plt.show()
Output
Advertisements