Discussion:
[R] How can I write the square root symbol in an axes label?
21rosit
2012-10-08 22:42:11 UTC
Permalink
<Loading Image...>

How can I write the square root symbol in an axes label like in the attached
picture?
Thanks a lot



--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-square-root-symbol-in-an-axes-label-tp4645497.html
Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2012-10-08 23:42:05 UTC
Permalink
Post by 21rosit
<http://r.789695.n4.nabble.com/file/n4645497/square_root.jpg>
How can I write the square root symbol in an axes label like in the attached
picture?
?plotmath

plot(1,1, xlab=expression( sqrt("Square Root Argument")) )


David Winsemius, MD
Alameda, CA, USA
William Dunlap
2012-10-08 23:46:20 UTC
Permalink
plot(1:10, ylab=bquote(sqrt(abs("Standardized Residuals"))))

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
Of 21rosit
Sent: Monday, October 08, 2012 3:42 PM
To: r-help at r-project.org
Subject: [R] How can I write the square root symbol in an axes label?
<http://r.789695.n4.nabble.com/file/n4645497/square_root.jpg>
How can I write the square root symbol in an axes label like in the attached
picture?
Thanks a lot
--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-
square-root-symbol-in-an-axes-label-tp4645497.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.
21rosit
2012-10-09 18:13:46 UTC
Permalink
And how can I write the units of my axis but outside the square root symbol
I have

plot(1:10, ylab=bquote(Log(sqrt("Total area (mm)"))))

but I need it as in the attached picture
<Loading Image...>



--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-square-root-symbol-in-an-axes-label-tp4645497p4645602.html
Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2012-10-09 18:32:37 UTC
Permalink
Post by 21rosit
And how can I write the units of my axis but outside the square root symbol
I have
plot(1:10, ylab=bquote(Log(sqrt("Total area (mm)"))))
but I need it as in the attached picture
<http://r.789695.n4.nabble.com/file/n4645602/square_root_mm1.jpg>
plot(1:10, ylab=bquote(Log(sqrt("Total area")~"(mm)")))

The tilde generates a space, while no space would occur if you substituted "*" for the "~".
--
David Winsemius, MD
Alameda, CA, USA
William Dunlap
2012-10-09 18:41:18 UTC
Permalink
Look at help("plotmath").
plot(1:10, xlab=bquote(Log(sqrt("Total area") * (mm)))) # small space before (mm)
plot(1:10, xlab=bquote(Log(sqrt("Total area") ~ (mm)))) # more space before (mm)
# now use .(var) to interpolate value of variable 'var' into a plot label.
varName <- "Mean Acceleration" # render as uninterpreted text
units <- bquote(m/s^2) # render in math notation
plot(1:10, xlab=bquote(Log(sqrt(.(varName)) ~ (.(units)))))
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
Of 21rosit
Sent: Tuesday, October 09, 2012 11:14 AM
To: r-help at r-project.org
Subject: Re: [R] How can I write the square root symbol in an axes label?
And how can I write the units of my axis but outside the square root symbol
I have
plot(1:10, ylab=bquote(Log(sqrt("Total area (mm)"))))
but I need it as in the attached picture
<http://r.789695.n4.nabble.com/file/n4645602/square_root_mm1.jpg>
--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-
square-root-symbol-in-an-axes-label-tp4645497p4645602.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.
David Winsemius
2012-10-09 18:32:37 UTC
Permalink
Post by 21rosit
And how can I write the units of my axis but outside the square root symbol
I have
plot(1:10, ylab=bquote(Log(sqrt("Total area (mm)"))))
but I need it as in the attached picture
<http://r.789695.n4.nabble.com/file/n4645602/square_root_mm1.jpg>
plot(1:10, ylab=bquote(Log(sqrt("Total area")~"(mm)")))

The tilde generates a space, while no space would occur if you substituted "*" for the "~".
--
David Winsemius, MD
Alameda, CA, USA
William Dunlap
2012-10-09 18:41:18 UTC
Permalink
Look at help("plotmath").
plot(1:10, xlab=bquote(Log(sqrt("Total area") * (mm)))) # small space before (mm)
plot(1:10, xlab=bquote(Log(sqrt("Total area") ~ (mm)))) # more space before (mm)
# now use .(var) to interpolate value of variable 'var' into a plot label.
varName <- "Mean Acceleration" # render as uninterpreted text
units <- bquote(m/s^2) # render in math notation
plot(1:10, xlab=bquote(Log(sqrt(.(varName)) ~ (.(units)))))
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
Of 21rosit
Sent: Tuesday, October 09, 2012 11:14 AM
To: r-help at r-project.org
Subject: Re: [R] How can I write the square root symbol in an axes label?
And how can I write the units of my axis but outside the square root symbol
I have
plot(1:10, ylab=bquote(Log(sqrt("Total area (mm)"))))
but I need it as in the attached picture
<http://r.789695.n4.nabble.com/file/n4645602/square_root_mm1.jpg>
--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-
square-root-symbol-in-an-axes-label-tp4645497p4645602.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.
21rosit
2012-10-09 18:13:46 UTC
Permalink
And how can I write the units of my axis but outside the square root symbol
I have

plot(1:10, ylab=bquote(Log(sqrt("Total area (mm)"))))

but I need it as in the attached picture
<http://r.789695.n4.nabble.com/file/n4645602/square_root_mm1.jpg>



--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-square-root-symbol-in-an-axes-label-tp4645497p4645602.html
Sent from the R help mailing list archive at Nabble.com.
21rosit
2012-10-08 22:42:11 UTC
Permalink
<http://r.789695.n4.nabble.com/file/n4645497/square_root.jpg>

How can I write the square root symbol in an axes label like in the attached
picture?
Thanks a lot



--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-square-root-symbol-in-an-axes-label-tp4645497.html
Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2012-10-08 23:42:05 UTC
Permalink
Post by 21rosit
<http://r.789695.n4.nabble.com/file/n4645497/square_root.jpg>
How can I write the square root symbol in an axes label like in the attached
picture?
?plotmath

plot(1,1, xlab=expression( sqrt("Square Root Argument")) )


David Winsemius, MD
Alameda, CA, USA
William Dunlap
2012-10-08 23:46:20 UTC
Permalink
plot(1:10, ylab=bquote(sqrt(abs("Standardized Residuals"))))

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
Of 21rosit
Sent: Monday, October 08, 2012 3:42 PM
To: r-help at r-project.org
Subject: [R] How can I write the square root symbol in an axes label?
<http://r.789695.n4.nabble.com/file/n4645497/square_root.jpg>
How can I write the square root symbol in an axes label like in the attached
picture?
Thanks a lot
--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-write-the-
square-root-symbol-in-an-axes-label-tp4645497.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.
Continue reading on narkive:
Loading...