r - Is there an elegant way of having uniform font size for the whole plot in ggplot2 -


i read online size of fonts in plot plotted ggplot2 relative base_size specified in theme().

i found size of specific elements can modified doing like:

theme(axis.title.y = element_text(size = rel(1.5) ) 

i using theme_bw() , of text in plot: labels of axis, title of legend, items in legend, breaks in axis, have same font size. how can done?

edit:

i (almost) achieve want using theme_tufte() suggester @lawyer.

g + theme_tufte() + theme(axis.rect=element_line() ) 

gives me plot x , y axis drawn lines. have plot x , y axis form box.

how can draw box x , y axis?

i solved problem creating theme of own, combines theme_bw() basic theme + suggestion form @lukea, + custom stuff need.

theme_my <- function(base_size = 14, base_family = "palatino") {   txt <- element_text(size = 14, colour = "black", face = "plain")   bold_txt <- element_text(size = 14, colour = "black", face = "bold")    theme_bw(base_size = base_size, base_family = base_family) +   theme(     legend.key = element_blank(),      strip.background = element_blank(),       text = txt,      plot.title = txt,       axis.title = txt,      axis.text = txt,       legend.title = bold_txt,      legend.text = txt )  } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -