Change legend names when using plotBCV
2
0
Entering edit mode
Juan • 0
@juan-16911
Last seen 3.1 years ago
Newcastle University

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

edger plot Tutorial • 525 views
ADD COMMENT
1
Entering edit mode
Aaron Lun ★ 27k
@alun
Last seen 4 hours 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.

ADD COMMENT
1
Entering edit mode
@gordon-smyth
Last seen 2 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.

ADD COMMENT

Login before adding your answer.

Traffic: 330 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6