Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: plot(0,0,main=expression(italic(X*minute[1]))) plot(0,0,main=expression(italic(X[1]*minute))) plot(0,0,main=expression(italic(X)[1]*minute)) Any suggestions? Cheers, Marius
On 2011-04-06 14:14, Marius Hofert wrote:> Dear expeRts, > > I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: > > plot(0,0,main=expression(italic(X*minute[1]))) > plot(0,0,main=expression(italic(X[1]*minute))) > plot(0,0,main=expression(italic(X)[1]*minute)) > > Any suggestions?Hmm ....; your subject line is a clue: expression(italic(X)[1]^minute) Note the '^'. Peter Ehlers> > Cheers, > > Marius > ______________________________________________ > 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 Apr 6, 2011, at 5:14 PM, Marius Hofert wrote:> Dear expeRts, > > I would like to create a plotmath-label of the form X_1^\prime. Here > is how to *not* do it [not nicely aligned symbols]:Not all of us read LaTeX, so this is my initial guess at what you are requesting. The "*" after the '1' is a non-space plotmath separator. plot(0,0,main=expression(italic(X["`"*1])))> > plot(0,0,main=expression(italic(X*minute[1]))) > plot(0,0,main=expression(italic(X[1]*minute))) > plot(0,0,main=expression(italic(X)[1]*minute))If you wanted the tick after the 1, then think of 'minute' as a constant rather than as a function: plot(0,0,main=expression(italic(X[1*minute]))) Or: plot(0,0,main=expression(italic(X[minute*1])))> > Any suggestions?Greater effort at explanation that does not depend on intuiting your goal from erroneous code. -- David Winsemius, MD West Hartford, CT
thickness looks good, but length... it should be something in between the following two: plot(0,0,main=expression(italic(X)[1]^bolditalic("'"))) plot(0,0,main=expression(italic(X)[1]^bolditalic("|"))) On 2011-04-07, at 24:08 , David Winsemius wrote:> > On Apr 6, 2011, at 5:58 PM, Marius Hofert wrote: > >> Dear Peter, Dear David, >> >> this is also what I tried: plot(0,0,main=expression(italic(X)[1]^minute)) [as suggested by Peter]. The problem is that the prime seems so small/short when used with "^". Is there a way to get a thicker/larger prime? > > This any better? > > plot(0,0,main=expression(italic(X)[1]^bolditalic("'"))) > >> >> Cheers, >> >> Marius >> >> On 2011-04-06, at 23:22 , Peter Ehlers wrote: >> >>> On 2011-04-06 14:14, Marius Hofert wrote: >>>> Dear expeRts, >>>> >>>> I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: >>>> >>>> plot(0,0,main=expression(italic(X*minute[1]))) >>>> plot(0,0,main=expression(italic(X[1]*minute))) >>>> plot(0,0,main=expression(italic(X)[1]*minute)) >>>> >>>> Any suggestions? >>> >>> Hmm ....; your subject line is a clue: >>> >>> expression(italic(X)[1]^minute) >>> >>> Note the '^'. >>> >>> Peter Ehlers >>> >>>> >>>> Cheers, >>>> >>>> Marius >>>> ______________________________________________ >>>> 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 >
Haha, I found a hack (using the letter "l"): plot(0,0,main=expression(italic(X)[1]^bolditalic("l"))) Cheers, Marius
On 2011-04-06 15:21, Marius Hofert wrote:> Haha, I found a hack (using the letter "l"): > > plot(0,0,main=expression(italic(X)[1]^bolditalic("l")))To my eye, this is a bit neater: expression(italic(X)[1]^bold("/")) Peter> > Cheers, > > Marius
the tikzDevice package has offered a way to write native LaTeX expressions in R plots, so no tricks are really needed there Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Thu, Apr 7, 2011 at 12:01 AM, Marius Hofert <m_hofert at web.de> wrote:> Very nice! > > Cheers, > > Marius > > On 2011-04-07, at 04:38 , Dennis Murphy wrote: > >> Here are a couple more possibilities: >> >> plot(0, 0, main = expression(italic(X)[1]^bold(scriptscriptstyle("/")))) >> plot(0, 0, main = expression(italic(X)[1]^bolditalic(scriptscriptstyle("/")))) >> >> The latter increases the angle a tad. >> >> HTH, >> Dennis >> >> On Wed, Apr 6, 2011 at 3:49 PM, Peter Ehlers <ehlers at ucalgary.ca> wrote: >> On 2011-04-06 15:21, Marius Hofert wrote: >> Haha, I found a hack (using the letter "l"): >> >> plot(0,0,main=expression(italic(X)[1]^bolditalic("l"))) >> >> To my eye, this is a bit neater: >> >> ?expression(italic(X)[1]^bold("/")) >> >> Peter >> >> >> >> Cheers, >> >> Marius >> >> ______________________________________________ >> 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. >
Karl Ove Hufthammer
2011-Apr-13 14:05 UTC
[R] Quiz: Who finds the nicest form of X_1^\prime?
Marius Hofert wrote:> Haha, I found a hack (using the letter "l"): > > plot(0,0,main=expression(italic(X)[1]^bolditalic("l")))Why cheat when you can use a *real* prime character: plot(0, 0, main=expression(paste(italic(X)[1],"\u2032"))) -- Karl Ove Hufthammer
Possibly Parallel Threads
- lattice + plotmath: how to get a variable in bold face?
- splom, plotmath: how to add three lines of information with alignment?
- Calculation of e^{z^2/2} for a normal deviate z
- How to use expression(italic()) in a "vectorized" way (within a function)?
- lattice: How to vertically adjust an axis label?