Jump to content
You must now use your email address to sign in [click for more info] ×

pdf from matplotlib not showing properly in ADesigner


Recommended Posts

Good afternoon

I am using Affinity Designer (last version) on Windows 10 for my work. I have generated a pdf with matplotlib on python. The pdf looks ok (see attached) but the labels do not display properly when opening the file with Affinity Designer (see the screenshot). However, the pdf displays correctly in Illustrator.

Could you help me with this problem? I imagine other people doing analytical/sciency work might have encountered the same issue!

Many thanks,

Hugo

line plot in affinity.JPG

line_plot.pdf

Link to comment
Share on other sites

There is something wrong with the PDF, I selected the gape_h and used the Mac's look up definition/ check spelling feature. this is what I saw,

558895987_ScreenShot2021-03-13at8_59_06AM.png.6d12f8903c6b2b561193832f14c46f04.png

 

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

  • 11 months later...
37 minutes ago, Timon said:

I face the same issue using different pdf's, but also with svg files saved with seaborn / matplotlib.

A couple of things. The PDF needs a font I don't have. If I do a Save As... (make a copy) with Apple's Preview application I do not have the messed up text problem.

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

1 hour ago, Old Bruce said:

A couple of things. The PDF needs a font I don't have. If I do a Save As... (make a copy) with Apple's Preview application I do not have the messed up text problem.

So Affinity Designer needs a specific font in order to work, that the other apps, e.g. Foxit Reader, Firefox, Edge all seem to support?
Maybe this font could also be added to be read by Affinity?

Also under Windows the fix with saving it again does not seem to work with any of the upper mentioned sw.
I am also unable to fix it by changing the font with seaborn:

sns.set(font="Verdana")

I think I forgot to mention my Affinity Designer version: 1.10.4.1198

Link to comment
Share on other sites

On 3/15/2021 at 4:49 PM, Sean P said:

Hi Hugod,

Interestingly Acrobat can read and copy the text ok on Windows. I'm going to pass it on to development to see if there is anything that can be done.
 

Is a follow up or bug fix of that? @Hugodhow did you manage it fix it in the end?

Link to comment
Share on other sites

You say you have problems 'using' these PDFs, are you opening them or are you placing them in a Designer Document. If the latter could you not just use Passthrough mode?1461750436_ScreenShot2022-03-06at9_52_09AM.png.5c9f30f9d198053e269e11b33d34dfc1.png

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

My idea is to use matplotlib / seaborn to export the Figures as pdf, svg or any other possible format; and then use Affinity Designer to make adjustments.

Only having the "Passthrough" option works indeed, but if I want to make specific changes, e.g. increasing some Font size etc, I need to use the "Interpre"t Option, which somehow fails.
I wish there could be a fix/workaround/hack for that :(

Link to comment
Share on other sites

3 hours ago, Timon said:

Unfortunately setting the font's wont change, e.g. here to Times New Roman. Affinity designer still see's the other font, here DejaVuSans, and fails opening all fonts correctly.

 

DejaVuSans Oblique and Regular are applied to the R2 over on the far left.
The change from Arial to Times New Roman did not affect that.

Affinity apps have an issue with how matplotlib writes (codes) the text in both the PDF and the SVG formats. Some other applications, including PDF editors, are able to interpret this as text. But some other applications also have an issue with it (open the SVG in Inkscape and look at the "text").
Open the SVG in a text editor and try to find the "text" (the actual text, not the comments).
There is another discussion around here somewhere about the text coding in these files.

Bottom line is there is no way to edit these in Affinity apps at this time.

Link to comment
Share on other sites

  • 8 months later...

Also the newly released version 2 of Affinity Designer is still not able to load .svg/.pdf files created by Matplotlib correctly. Other vector graphic editors (even the free Inkscape), pdf viewers and web browsers do not have these bugs.

I hope the developers understand that this is not just an annoying bug. These bugs make it literally impossible to use Designer efficiently for graphics in the scientific community in general. If I create several graphics and at least one of them includes a file from matplotlib I won't use a different tool just for this one graphic. I switch the tool for all graphics of this project. And since this is the case for almost 99% of my projects Designer is not useful for me at all at this point.

I had big hopes for this update and my colleagues and I are extremely disappointed. It's also a big loss for the scientific community. I hope this will be fixed in the future but I am afraid many users will have permanently switched to a different tool by then. I will probably try it again in some months but I almost lost hope in this product by now.

Link to comment
Share on other sites

  • 6 months later...

it might be due to the matplotlib backend in Windows machine, you could try the following step:
1. `pip install pycairo` in your python environment 

2. call `matplotlib.use("Cairo")` in your python script

please let me know if it's help? related github issue:
https://github.com/matplotlib/matplotlib/issues/12636/?fbclid=IwAR1ymfx8xKTuKjUi0qVlza1ekNVSbutj5o7xWBUqC6azFSsUML64kIlv2A8

Link to comment
Share on other sites

  • 4 months later...

 

On 5/15/2023 at 1:33 PM, Simon Wei said:

it might be due to the matplotlib backend in Windows machine, you could try the following step:
1. `pip install pycairo` in your python environment 

2. call `matplotlib.use("Cairo")` in your python script

please let me know if it's help? related github issue:
https://github.com/matplotlib/matplotlib/issues/12636/?fbclid=IwAR1ymfx8xKTuKjUi0qVlza1ekNVSbutj5o7xWBUqC6azFSsUML64kIlv2A8

@Simon Wei This solved the issue for me, thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.