fpc-sim icon indicating copy to clipboard operation
fpc-sim copied to clipboard

Python plot issue

Open ouya99 opened this issue 6 years ago • 4 comments

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()

ouya99 avatar Sep 27 '19 17:09 ouya99

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.

apenzk avatar Oct 09 '19 12:10 apenzk

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.

Tony-sy avatar Dec 01 '20 11:12 Tony-sy

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.

smetterspa avatar Jan 09 '21 14:01 smetterspa

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)

rkrutyholowa avatar May 17 '21 16:05 rkrutyholowa