I want to generate a vector plot with matplotlib. I tried hard - but the output is a raster image. Here's what I use:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
and finally:
myfig.savefig('myfig.eps', format='eps')
I've found that export to ps
gives a vector image, but the problem with eps
remains.
I use the following code:
Try exporting as a pdf or svg as described in http://neuroscience.telenczuk.pl/?p=331 If you need an eps the pdf2ps command works great.
If you need emf files as output format, e.g. to insert high quality plots into ms word/powerpoint and you are willing to use inkscape as converter you can apply this solution:
In order to test this function you can run a simple example: