Search
Question: Change legend names when using plotBCV
0
gravatar for Juan
3 months ago by
Juan0
Newcastle University
Juan0 wrote:

Hi

I´m using plotBCV which has a legend included in the top-right corner of the plot. I would like to change the names in the legend because when I reduce the size of the plot to export it to pdf, the names in the legend goes out of the box. I tried using the same I did with plot but it didn´t work.

Code and error:

plotBCV(y,cex.axis=1.1,cex.lab=1.1, cex.main=1.4, main="scox-miec.raw", legend(2.5,5,legend=c("Tag","Com","Trend")))

 

Error in title(...) : parámetro gráfico inválido

Many thanks

Juan

ADD COMMENTlink modified 3 months ago by Gordon Smyth35k • written 3 months ago by Juan0
1
gravatar for Aaron Lun
3 months ago by
Aaron Lun21k
Cambridge, United Kingdom
Aaron Lun21k wrote:

No, you can't change the legend names. If you want to customize the plot beyond what is allowed by the current options, it is straightforward to rip the code out of plotBCV. I mean, it's just some points for y$tagwise.dispersion; a trend line for y$trended.dispersion versus y$AveLogCPM; and a horizontal line at y$common.dispersion. (All of these values should be square-rooted if you want the BCV.) Pretty easy to do in a few lines.

ADD COMMENTlink written 3 months ago by Aaron Lun21k
1
gravatar for Gordon Smyth
3 months ago by
Gordon Smyth35k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth35k wrote:

I suspect that you might be shrinking a graphics Window without redrawing the plot. When you reduce the size of the plotting window, you have to redraw the plot. Then the legend will stay in the box and there will be no problem.

You should not need to change the legend labels. You also should not usually need to set the cex sizes because those will reset automatically according to the Window size.

ADD COMMENTlink modified 3 months ago • written 3 months ago by Gordon Smyth35k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 162 users visited in the last hour