Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make markers on lines smaller in matplotlib?

The documentation on matplotlib markers here teaches me I can have several styles of the markers. For example, I may have '-o' for circles on the line, '-*' for stars on the line and '-s' for square on the line.

However, they all appear to be too big for me. Like, when I do

axes.errorbar(x, y, yerr=ci, fmt='-o', color='k')

I get

enter image description here

To make them smaller, I tried

axes.errorbar(x, y, yerr=ci, fmt='-o', s=1, color='k')

but no luck.

How to make the markers on a line smaller?

like image 562
Sibbs Gambling Avatar asked Nov 18 '13 12:11

Sibbs Gambling


People also ask

How do you change the size of points on a scatter plot?

The points in the scatter plot are by default small if the optional parameters in the syntax are not used. The optional parameter 's' is used to increase the size of scatter points in matplotlib.

What is marker size in matplotlib?

The standard size of points in matplotlib is 72 points per inch (ppi) - 1 point is hence 1/72 inches.


1 Answers

You can use markersize argument to change the size of the markers:

plt.errorbar(x, y, yerr=err, fmt='-o',  markersize=2, color='k', label = 'size 2')

Like so

enter image description here

like image 113
dnf0 Avatar answered Oct 02 '22 00:10

dnf0