2
DOLMin<-as.Date("2012-1-1")
DOLMax<-as.Date("2012-12-31")
title<-paste("Claims:",format.Date(DOLMin,"%b %Y"),"\u2264 DOL \u2264",format.Date(DOLMax,"%b %Y"))
plot(1:2,main=title)

The above code creates this meaningless plot enter image description here

My problem is that I cannot build a pdf of this plot because of the way I'm generating my less than or equal to symbols.

How do I recreate the same title using plotmath? Doing so will solve my pdf error issue which I describe here

3
  • Well, read ?plotmath. Commented Jan 17, 2014 at 22:45
  • 1
    @Roland I read ?plotmath and still could not figure out how to get my title the way I want it. Can you provide a working solution for my question or at least give me a suggestion other than read ?plotmath Commented Jan 17, 2014 at 23:00
  • 1
    Thanks. I figure if neither I nor joran can do it without a search of more than the help page you ought to get credit for a relatively difficult question. I consider myself a power user of plotmath but I was stuck. Commented Jan 18, 2014 at 0:49

1 Answer 1

4

This was a little tricky:

a <- paste("Claims:",format.Date(DOLMin,"%b %Y"))
b <- format.Date(DOLMax,"%b %Y")
plot(1:2,main=bquote({.(a) <= DOL} <= .(b)))

I actually was not able to do this when I read your question. I figured it out by Googling and using the results from this SO question and then this one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.