In python, create your figure and save it as .eps
. This will generate a vector image of your figure:
fig, ax = plt.subplots()
ax.plot(range(10))
fig.savefig('straightLine.eps', format='eps')
Using ghostscript and ImageMagick, convert to .jpg
, defining the resolution using the -density
flag.
epstopdf straightLine.eps
convert -density 1200 -trim straightLine.pdf -quality 100 straightLine.jpg