I am trying to plot a bunch of data points (many thousands) in Python using matplotlib so I need each marker to be very small and precise. How do I get the smallest most simple marker possible? I use this command to plot my data:
matplotlib.pyplot( x , y ,'.',markersize=0.1,linewidth=None,markerfacecolor='black')
Then I can look at it either with pl.show()
and then save it. Or directly use plt.savefig('filename.ps')
in the code to save it. The problem is this: when I use pl.show()
to view the file in the GUI it looks great with small tiny black marks, however when I save from the show()
GUI to a file or use directly savefig
and then view the ps
I created it looks different! Each marker has gained a little blue halo around it (as if it started at each point to connect them with the default blue lines, but did not) and the style is all wrong. Why does it change the style when saved? How do I stop python from forcing the style of the markers? And yes I have looked at some alternative packages like CairoPlot, but I want to keep using matplotlib for now.
Update: It turns out that the save to PNG first makes the colors turn out okay, but it forces a conversion of the image when I want to save it again as a .ps
later (for inclusion in a PDF) and then I lose quality. How do I preserve the vector nature of the file and get the right formatting?