Python plot issue
if I enter,
python plot.py
I get the following error message due to some eps output problem I suppose
The PostScript backend does not support transparency; partially transparent artists will be rendered opaque.
Removing/uncommenting the savefig and clf commands resolves this issue. A simple plt.show() does the job. This works also for "python plot2d.py"
plt.show()
# plt.savefig(filename+'.eps', format='eps')
# plt.clf()
Thanks for the comment. The error message itself does not seem to have effects on the output of the script, but if the output is not intended to be saved this is an option.
If you just need to show your figure in the editor, no need to save it as eps. When you show it, it will be presented as a PNG image, that is why the problem is solved when deleting the savefig command.
But if the intent is to save the output as a .eps format file, it would be ideal if the warning message could be suppressed using the standard warnings.filterwarnings("ignore") library command since, as noted by apenzk, the error message itself does not seem to have effects on the output of the script.
I had the same issue with *.eps that is not supported properly. I resolved that by saving as *.svg which handles transparency nicely:
plt.savefig("filename.svg", format="svg",transparent=True)