Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6542797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:16:13+00:00 2026-05-25T11:16:13+00:00

ggplot2: Why Does Semi-Transparency + pdflatex Cause Heavier-Than-Normal PDF Fonts? I’ve run into a

  • 0

ggplot2: Why Does Semi-Transparency + pdflatex Cause Heavier-Than-Normal PDF Fonts?

I’ve run into a problem where pdf()ing in R and then pdflatex-ing a ggplot2 image causes all of the text on the same page as the image to become emboldened, but only when alpha < 1. Here’s a minimal example in R:

require("ggplot2")
"%_%" <- function(a, b) paste(a, b, sep="")
test <- function(filename, alpha)
{
  pdf(filename %_% "-fig.pdf")
  p <- ggplot(mtcars, aes(wt, mpg)) + geom_point(alpha=alpha)
  print(p); dev.off()

  latexDocument <- c(
    "\\documentclass{article}",
    "\\usepackage{Sweave}",
    "%\\pdfpageattr{/Group <</S /Transparency /I true /CS /DeviceRGB>>}",
    "\\begin{document}",
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "\\begin{figure}",
    "\\includegraphics{" %_% filename %_% "-fig}",
    "  \\caption{Figure Caption}",
    "\\end{figure}",
    "\\end{document}")

  con <- file(filename %_% ".tex"); writeLines(latexDocument, con); close(con)
  system("pdflatex " %_% filename)
}

test("test1", 1)
test("test2", 0.3)

Comparing the output files test1.pdf and test2.pdf, I notice that the latter document has heavier fonts when viewed in Acrobat or Acrobat Reader. The problem has been discussed here before, but to no resolution.

I can’t seem to solve the problem, which messes up the look of reports I generate with Sweave. Does anyone have any insight into it? I’m using R version 2.13.1 on Windows.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:16:13+00:00Added an answer on May 25, 2026 at 11:16 am

    Try the pdf() function with an argument, colormodel = "cmyk"?

    require("ggplot2")
    pdf("test_cmyk.pdf", colormodel = "cmyk")
    ggplot(mtcars, aes(wt, mpg)) + geom_point(size = 3, alpha = 0.2) +
      opts(title = "cmyk, alpha = 0.2")
    dev.off()
    embedFonts("test_cmyk.pdf")
    

    It seems to be slightly better than colormodel = "rgb" in my environment (Win XP, Adobe Acrobat 9 Pro).

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to merge two ggplot2 plots into one based on this table:
In ggplot2, there is a usage which looks like: geom_segment(aes(x=x0,y=y0,xend=x1,yend=y1)) What does the aes(x=x0,y=y0,xend=x1,yend=y1)
Does anybody know of a general way to embed plots into other plots to
library(ggplot2) my_title = This is a really long title of a plot that I
library(ggplot2) This code produces a nice looking plot: qplot(cty, hwy, data = mpg, colour
I'm using ggplot2 to make some bullseye charts in R. They look delightful, and
Trying the ggplot2 examples in the online reference manual, and particularly in this page
I am using ggplot2 to plot a figure that contains nine facets. Each facet
I have a couple of questions regarding facetting in ggplot2... Let's say I have
I have a scatter plot in R (with ggplot2). The data has a numeric

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.