Change legend names when using plotBCV
Entering edit mode
Juan • 0
Last seen 5.1 years ago
Newcastle University


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


edger plot Tutorial • 1.1k views
Entering edit mode
Aaron Lun ★ 28k
Last seen 32 minutes ago
The city by the bay

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.

Entering edit mode
Last seen 8 hours ago
WEHI, Melbourne, Australia

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.


Login before adding your answer.

Traffic: 346 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6