Hi, all, I am a newbie for [r]. I am currently trying to learn this example. http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ I know if I need to show the graph properly, I need to update the theme by this command: *> immigration_theme <- theme_update(axis.text.x = theme_text(angle = 0, hjust = 0.5, size=20), axis.text.y = theme_text(angle = 0, hjust = 0.5, size=20), panel.grid.major = theme_line(colour = "grey90"), panel.grid.minor = theme_blank(), panel.background = theme_blank(), axis.ticks theme_blank(), legend.position = "none")* However, everytime when I close the r programme and run it again, I need to rerun theme_update again in order to show the picture properly. That is, the theme_update could not really update the theme after I close [r]. So, how could I change the parameters permenantly using theme_update? I am tired to google for the theme_update for 3 days... Hope some genius could help. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/ggplot-theme-update-tp4354015p4354015.html Sent from the R help mailing list archive at Nabble.com.
Hi Nameless, You would have to add your code to the source of the ggplot2 package to make it permanent. But that not a vary good idea. Just add the line to your script and rerun it when you restart your analysis. Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54 43 61 85 Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -----Oorspronkelijk bericht----- Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Namens vd3000 Verzonden: vrijdag 3 februari 2012 9:31 Aan: r-help at r-project.org Onderwerp: [R] ggplot theme_update Hi, all, I am a newbie for [r]. I am currently trying to learn this example. http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ I know if I need to show the graph properly, I need to update the theme by this command: *> immigration_theme <- theme_update(axis.text.x = theme_text(angle = 0, hjust = 0.5, size=20), axis.text.y = theme_text(angle = 0, hjust = 0.5, size=20), panel.grid.major = theme_line(colour = "grey90"), panel.grid.minor = theme_blank(), panel.background = theme_blank(), axis.ticks = theme_blank(), legend.position = "none")* However, everytime when I close the r programme and run it again, I need to rerun theme_update again in order to show the picture properly. That is, the theme_update could not really update the theme after I close [r]. So, how could I change the parameters permenantly using theme_update? I am tired to google for the theme_update for 3 days... Hope some genius could help. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/ggplot-theme-update-tp4354015p4354015.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On Feb 3, 2012, at 10:14 AM, ONKELINX, Thierry wrote:> Hi Nameless, > > You would have to add your code to the source of the ggplot2 package > to make it permanent. But that not a vary good idea. > > Just add the line to your script and rerun it when you restart your > analysis. >Or add it ( after executing load(ggplot2) ) to .Rprofile which gets executed at R Startup: ?Startup -- David.> Thierry > > ir. Thierry Onkelinx > Instituut voor natuur- en bosonderzoek / Research Institute for > Nature and Forest > team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance > Kliniekstraat 25 > 1070 Anderlecht > Belgium > + 32 2 525 02 51 > + 32 54 43 61 85 > Thierry.Onkelinx at inbo.be > www.inbo.be > > To call in the statistician after the experiment is done may be no > more than asking him to perform a post-mortem examination: he may be > able to say what the experiment died of. > ~ Sir Ronald Aylmer Fisher > > The plural of anecdote is not data. > ~ Roger Brinner > > The combination of some data and an aching desire for an answer does > not ensure that a reasonable answer can be extracted from a given > body of data. > ~ John Tukey > > -----Oorspronkelijk bericht----- > Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] Namens vd3000 > Verzonden: vrijdag 3 februari 2012 9:31 > Aan: r-help at r-project.org > Onderwerp: [R] ggplot theme_update > > Hi, all, > > I am a newbie for [r]. > > I am currently trying to learn this example. > http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ > http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ > > I know if I need to show the graph properly, I need to update the > theme by this command: > > *> immigration_theme <- theme_update(axis.text.x = theme_text(angle > = 0, hjust = 0.5, size=20), axis.text.y = theme_text(angle = 0, > hjust = 0.5, size=20), panel.grid.major = theme_line(colour = > "grey90"), panel.grid.minor = theme_blank(), panel.background = > theme_blank(), axis.ticks = theme_blank(), legend.position = "none")* > > However, everytime when I close the r programme and run it again, I > need to rerun theme_update again in order to show the picture > properly. That is, the theme_update could not really update the > theme after I close [r]. > > So, how could I change the parameters permenantly using theme_update? > > I am tired to google for the theme_update for 3 days... > > Hope some genius could help. > > Thanks. > > > -- > View this message in context: http://r.789695.n4.nabble.com/ggplot-theme-update-tp4354015p4354015.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD West Hartford, CT