solution for image distortion from Python's matplotlib to pdf

created at 06-27-2021 views: 3

Problem Description:

After Python runs the simulation image, it is usually copied directly into the word. I did the same at the beginning, it was very clear in the word.

It is still clear enough after zooming in the word, as follows:

But after saving as pdf, the picture will be distorted after zooming in, as follows:

solution

Just add a statement before plt.show():

plt.savefig('./filename.svg', format='svg')

Save the picture in svg format, and then insert the generated svg file into word.

Please log in to leave a comment.