[R] What is the ggplot analog of the axis() function?

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Sun Feb 16 23:31:59 CET 2020


Hello,

In ggplot2, to set the placement and labels of the axis use

?scale_x_continuous
?scale_y_continuous

and similar functions. The arguments you would want are 'breaks' and 
'labels'.

Then you can further customize with ?theme. Arguments such as axis.text 
or axis.ticks are what you would use.

This is a (very) broad question, if you have doubts in something more 
specific, say so.

Hope this helps,

Rui Barradas

Às 20:35 de 16/02/20, p_connolly escreveu:
> Using base R graphics I can customize the position of the tick marks and 
> what text to label them by using the axis function and adjusting the 
> `at` and `labels` parameters respectively.
> 
> What theme setting do I adjust using ggplot2 graphics to achieve a 
> similar result?
> 
> TIA
> 
> Patrick
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list