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

  • Home
  • SEARCH
  • 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 8798795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:10:33+00:00 2026-06-14T00:10:33+00:00

I have a list of all theme elements stored as a theme that is

  • 0

I have a list of all theme elements stored as a theme that is evoked before plotting. However, I recently found that when I export to pdf and try to open in Adobe Illustrator, I get an error “Acrobat PDF File Format is having difficulties.” I’ve also seen Illustrator report that it has “Too few operands.” However, when I use a standard theme (say, theme_set(theme_gray())), there’s no problem in Illustrator. Also, regardless of the theme, I don’t have issues with plotting or saving modified figures.

Perhaps someone can suggest a) the best way to store and evoke large quantities of theme settings, and b) what could be the source of my ggplot2 -> pdf -> Illustrator woes.

Here is my current theme, how I evoke it, and a sample plot. Note that some of the parameters are commented out, serving as placeholders if I should need them later.

textc <- "grey20"
gridc <- "grey20"
backc <- "white"
fontsize <- 12

new_theme <- theme_set(theme_update(  
  #axis.title = element_text()
  axis.title.x = element_text(colour=textc,size=fontsize,angle=0,hjust=.5,vjust=.5,face="plain"),
  axis.title.y = element_text(colour=textc,size=fontsize,angle=90,hjust=.5,vjust=.5,face="plain"),

  #axis.text = element_text()
  axis.text.x = element_text(colour=textc,size=fontsize,angle=0,hjust=.5,vjust=1.5,face="plain"),
  axis.text.y = element_text(colour=textc,size=fontsize,angle=0,hjust=1,vjust=0,face="plain"),

  axis.ticks = element_line(colour=gridc, size=0.5, linetype="solid"),
  axis.ticks.length = unit(.25,'cm'),
  axis.ticks.margin = unit(.25,'cm'), 

  axis.line = element_line(colour=gridc, size=NA, linetype="solid"),
  #axis.line.x = element_line()
  #axis.line.y = element_line()

  legend.background = element_rect(colour=NA,fill=NA,size=NA,linetype="solid"), # removes title and legend
  legend.margin = unit(0,"cm"),
  legend.key = element_rect(colour=NA,fill=NA,size=NA,linetype="solid"),
  legend.key.size = unit(1, 'cm'), # spacing between entries
  #legend.key.height = unit(),
  legend.key.width = unit(1,'cm'),
  legend.text = element_text(colour=textc,size=fontsize,angle=0,hjust=0,vjust=0,face="plain"),
  #legend.title.align =  0,#between 0 and 1
  legend.title = element_text(colour=textc,size=fontsize,angle=0,hjust=0,vjust=0,face="plain"),
  #legend.title.align = 0,# between 0 and 1

  #legend.position = "right"
  #legend.direction = "horizonal"
  #legend.justification = "center"
  #legend.box = "horizontal  

  panel.background = element_rect(colour=NA,fill=NA,size=NA,linetype="solid"),
  panel.border = element_rect(colour=NA,fill=NA,size=NA,linetype="solid"),
  panel.margin = unit(c(0, 0, 0, 0),'cm'),
  #panel.grid = element_line()
  panel.grid.major = element_line(colour=gridc, size=.4, linetype="dashed"),
  panel.grid.minor = element_line(colour=gridc, size=.4, linetype="dashed"),
  panel.grid.minor.x = element_blank(),
  panel.grid.major.x = element_blank(),
  #  panel.grid.minor.y = element_blank(),
  #  panel.grid.major.y = element_blank(),

  plot.background = element_rect(colour=NA,fill=backc,size=NA,linetype="solid"),
  plot.title = element_text(colour=textc,size=16,angle=0,hjust=0,vjust=1,face="plain"),
  plot.margin = unit(c(.25, .25, .25, .25),'in') # top, right, bottom, left

  #strip.background = element_rect(colour=NA,fill=NA,size=NA,linetype=NA),
  #strip.text
  #strip.text.x = element_text(colour=textc,size=fontsize,angle=0,hjust=0,vjust=0,face="plain"),
  #strip.text.y = element_text(colour=textc,size=fontsize,angle=-90,hjust=0,vjust=0,face="plain")
))

theme_set(theme_gray())
theme_set(new_theme)
options(scipen=9999) # suppress scientific notation


d <- ggplot(mtcars,aes(x=wt,y=mpg))+
  stat_binhex()+
  scale_fill_gradientn(colours=c("darkorange2","red","black"),name = "Frequency",na.value=NA)
try(ggsave(plot=d,filename=<some file.pdf>,height=4,width=6))

SessionInfo():

R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] grid      splines   stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] hexbin_1.26.0      lattice_0.20-10    reshape2_1.2.1     Hmisc_3.10-1       survival_2.36-14  
[6] plyr_1.7.1         RColorBrewer_1.0-5 ggplot2_0.9.2.1   

loaded via a namespace (and not attached):
 [1] cluster_1.14.3   colorspace_1.2-0 dichromat_1.2-4  digest_0.5.2     gtable_0.1.1    
 [6] labeling_0.1     MASS_7.3-22      memoise_0.1      munsell_0.4      proto_0.3-9.2   
[11] scales_0.2.2     stringr_0.6.1    tools_2.15.2 
  • 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-06-14T00:10:35+00:00Added an answer on June 14, 2026 at 12:10 am

    size=NA in axis.line = element_line(colour=gridc, size=NA, linetype="solid") cause the problem.
    Use element_blank if you do not want to show the line.

    This may not be a bug, but I suggest you to file this problem on github: https://github.com/hadley/ggplot2/issues
    In future, ggplot2 may have ability to check the validity of parameters.

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

Sidebar

Related Questions

I have a list of 400 strings that all end in _GONOGO or _ALLOC.
I have a list of numbers and need to put them all into a
I have a thumbnail image list, all of them have an attribute of 'rel'
I have a page with a list of Movies, and all of them have
I have a List<List<String>> I need to get a List of all possible concatenation
I have a PhoneGap app, where I need to list all the user's friends,
In my directory I have subfolders, and I want to list all directories like
I have a list of calling codes for all countries(the phone number prefixes), I
I have a list activity which display all running applications in the device. it's
I have a list of objects and I want to remove all the ones

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.