Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a simple way to change the plot axis decimal indicator from point to comma in base R?

I am making this simple plot

plot(data.frame(a=c(0.5,1,1.5,2,2.5,3,3.5,4),
                 b=c(0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08)))

I´ve seem lots off questions about how to make the axis decimal indicator a comma on ggplot2, but didn’t find any on base R.
I’m thinking something that adjust to the axis scale if the range of the data changes.
I know one could use xaxt = "n" and paste the values as text but wonder how that works with diferent ranges
Regards.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use options(OutDec = ",").

plot(data.frame(a=c(0.5,1,1.5,2,2.5,3,3.5,4),
                b=c(0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08)))

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading