How do I make small markers with matplotlib
Asked Answered
E

0

1

I am having trouble getting the markers small enough to fit my needs. I am using the code below to generate the plot.

import matplotlib.pyplot as plt

plt.rcParams['figure.dpi'] = 500

plt.plot(xvals, yvals, color='green', marker='.', linestyle='solid',markersize=1.0, linewidth=0.1,fillstyle='full')

plt.savefig('myPlotName.png')
plt.show()

My actual problem is, that the point markers will not get smaller with markersizes below 1.0. They stay at constant size, but are not filled anymore. The line thickness of the circle decreases with the markersize though.

See example pictures below. The full range of my data with marker size 1.0 and a close up using marker size 0.5.

Full data with marker size 1.0

Close up with marker size 0.5

I want to fit some smooth curves through this data and want to see the whole result. Therefore I am saving it to a picture at a high DPI value.

The fillstyle='full' did not change anything and I ran into the same problem using plt.scatter.

Is it just not the way matplolib is meant to be used as you would usually generate plots that shall fit on a usual page size? If so, what could I use with python instead?

Epithelium answered 11/8, 2020 at 22:4 Comment(2)
To get markers smaller than 1, you need to remove the edge. E.g. with markeredgecolor='none'Arrangement
Cheers, this totally solved it!Dilatory

© 2022 - 2024 — McMap. All rights reserved.