Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we have range_label flag to suppress data range heading? #288

Closed
binhpham79 opened this issue Mar 7, 2019 · 1 comment
Closed

Comments

@binhpham79
Copy link

binhpham79 commented Mar 7, 2019

Description

Hi Team,

By default the plot will add heading indicating data range automatically. But in some application such as econ we usually work with annual / quarterly / monthly data so that this heading is noisy due to its date format.

I think we just need a flag likes if range_label = TRUE (default) will be print the heading, else range_label = FALSE the heading is just "" (empty).

Of course, it is quite easy but I wish the team accepts this feature.

Thank you and best regards,

Expected behavior

  if (range_label == TRUE) {
  text.exp <- c(expression(text(xlim[1],0.5,main,font=2,col=theme$labels,offset=0,cex=1.1,pos=4)),
                expression(text(xlim[2],0.5,
                                paste(start(xdata[xsubset]),end(xdata[xsubset]),sep=" / "),
                                col=theme$labels,adj=c(0,0),pos=2)))
  }
  else {
  text.exp <- c(expression(text(xlim[1],0.5,main,font=2,col=theme$labels,offset=0,cex=1.1,pos=4)),
                expression(text(xlim[2],0.5,
                                paste(""),
                                col=theme$labels,adj=c(0,0),pos=2)))
  } 
  cs$add(text.exp, env=cs$Env, expr=TRUE)

@joshuaulrich
Copy link
Owner

Thanks for the report! This is very similar to #247, so I'm going to close it as a duplicate. It will be addressed when the other ticket is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants