Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PDF format figures #28

Merged
merged 3 commits into from
Dec 29, 2023
Merged

Add PDF format figures #28

merged 3 commits into from
Dec 29, 2023

Conversation

zietzm
Copy link
Collaborator

@zietzm zietzm commented Dec 28, 2023

@dhimmel
Copy link
Collaborator

dhimmel commented Dec 29, 2023

Nice!

What method did you use to create the eps files? ggplot2::ggsave in R?

Things look good except for any elements involving transparency. For example, a screenshot of auroc_dists.eps from my desktop Evince viewer:

image

Notice how the points, which have transparency, have been rasterized.

Apparently, there might be an R fallback_resolution argument for "the resolution in dpi used when falling back to bitmap output" that we could increase to 600. But that wouldn't fix the underlying problem that EPS does not support transparency and hence transparent items are rasterized.

From the stack:

The PostScript graphics model itself does not support general transparency of page elements at all. (Hence it is also not possible for EPS.) PostScript colors are all fully opaque.

An object drawn on top of another object would overwrite and cover all lower objects with its own color leaving no room for transparent effects. (If you see something that looks like transparency overlays in a PostScript viewer or printout, then that was only emulated transparency, by flattening the two (or more) respective objects into one single rasterized area creating the illusion of transparency.)

If you must use EPS, use a two-step process:

  • Create the PDF first.
  • Then convert from the (transparency-enabled) PDF to EPS, 'flattening' the transparent elements into rasterized areas which emulate the desired transparency effect.

For connectivity search, we had some luck first creating a PDF and then running pdftops -rasterize never. But output must be checked.

So if not too much of a pain, I think we should export to PDF. And then we can see if we can get emulated vector transparency via a different program for converting PDF to EPS. I'll comment on individual files if things already look good.

/g 37 def
/p 38 def
end readonly def
/sfnts [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For img/feature-auroc.eps, it might be easiest to just remove transparency from points altogether. Their fill can be adjusted to keep the same colors if desired. There's a single overplotting, but we'd still see some of the background point. Dashed vline should go behind points if easy.

@@ -0,0 +1,1067 @@
%!PS-Adobe-3.0 EPSF-3.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this figure in supplement, so EPS likely not needed, but also it looks totally good... no transparency

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hetionet_degrees.eps looks good as is

@zietzm
Copy link
Collaborator Author

zietzm commented Dec 29, 2023

What method did you use to create the eps files? ggplot2::ggsave in R?

Exactly! I just modified the extension in each file name.

Regarding Gigascience, is there a reason we prefer EPS over PDF for vector graphics? It seems like Gigascience prefers PDF.

@dhimmel
Copy link
Collaborator

dhimmel commented Dec 29, 2023

Regarding Gigascience, is there a reason we prefer EPS over PDF for vector graphics?

Ah wow the instructions to authors does say:

Vector figures should if possible be submitted as PDF files, which are usually more compact than EPS files.

Submitting PDFs would be infinitely better and easier than EPS files! But now I'm sort of confused why Gigascience/Aptara requesed EPS files for connectivity search in order to create vectors instead of PDF. So let's try PDF and see what happens.

@zietzm
Copy link
Collaborator Author

zietzm commented Dec 29, 2023

Ok! I'll push one more commit that just puts all the figures into PDF format then.

@zietzm zietzm changed the title Add EPS format figures Add PDF format figures Dec 29, 2023
@zietzm zietzm merged commit 87e88d4 into greenelab:main Dec 29, 2023
@zietzm zietzm deleted the eps branch December 29, 2023 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants