Matplotlib in Python
Matplotlib in Python
How to Plot Circles in Matplotlib (With Examples)
You can quickly add circles to a plot in Matplotlib by using the Circle() function, which uses the following syntax:
matplotlib.patches.Circle(xy, radius=5)
where:
xy: The (x, y)...
Matplotlib in Python
How to Adjust Marker Size in Matplotlib (With Examples)
You can use the s argument to adjust the marker size of points in Matplotlib:
plt.scatter(x, y, s=40)
The following examples show how to use...
Matplotlib in Python
How to Create a Quiver Plot in Matplotlib (With Examples)
A quiver plot is a type of plot that displays arrows with directional components U and V at the Cartesian coordinates specified by X and Y.
We...
Matplotlib in Python
How to Add Text to Matplotlib Plots (With Examples)
You can easily add text to a Matplotlib plot by using the matplotlib.pyplot.text() function, which uses the following syntax:
matplotlib.pyplot.text(x, y, s, fontdict=None)
where:
x: The x-coordinate...
Matplotlib in Python
How to Set the Aspect Ratio in Matplotlib
The aspect ratio of a matplotlib plot refers to the aspect of the axis scaling, i.e. the ratio of y-unit to x-unit.
This ratio can...
Matplotlib in Python
How to Adjust Line Thickness in Matplotlib
You can easily adjust the thickness of lines in Matplotlib plots by using the linewidth argument function, which uses the following syntax:
matplotlib.pyplot.plot(x, y, linewidth=1.5)
By...
Matplotlib in Python
How to Adjust Spacing Between Matplotlib Subplots
Often you may use subplots to display multiple plots alongside each other in Matplotlib. Unfortunately, these subplots tend to overlap each other by default.
The...
Subscribe
- Never miss a story with notifications
- Gain full access to our premium content
- Browse free from up to 5 devices at once
Must read