Entering edit mode
David Ruau
▴
190
@david-ruau-1562
Last seen 10.2 years ago
Hi,
I am trying to plot 2 plots in the same PDF.
The plot are 2 identical dendrograms except for the leave's label
(some labels are empty). I would like to plot the first one in red and
the second one in black. The idea I have is to use the second one as a
mask hiding the red dendrogram on the common part.
> class(dend1)
[1] "dendrogram"
> class(dend2)
[1] "dendrogram"
##### Here the plot are merged but everything is red
> pdf(file="color_dendrogram.pdf", height=100, width=400)
> plot(dend2, col="red", panel.last=plot(dend1, col="black"))
> dev.off()
##### Here the plot are merged but everything is black...
> plot(dend2, panel.first=par(col="red"), panel.last=plot(dend1,
panel.first=par(col="black")))
The final graph should be black (from dend1) and some of the label red
(from dend2).
David
> sessionInfo()
R version 2.7.0 (2008-04-22)
x86_64-unknown-linux-gnu
locale:
C
attached base packages:
[1] tools stats graphics grDevices utils datasets
methods
[8] base
other attached packages:
[1] lattice_0.17-6 bioDist_1.10.0 Biobase_2.0.1
loaded via a namespace (and not attached):
[1] grid_2.7.0