Closed ksw9 closed 4 years ago
Hi,
You can set xlim
and ylim
to be the same for all plots, something like:
xl <- c(-10, 10)
yl <- c(-15, 16)
plot(net, xlim = xl, ylim = yl, .....) # for all nets
That will work nicely if all plots use the same space on your graphical device. Otherwise, for instance if you use:
layout(matrix(1:6, 2, 3, byrow = TRUE), widths = c(1, 1, 2))
to split your device you'll need to rescale xl
and yl
with respect to the size of the plots (but apparently this is not your case from the pic you included).
Cheers,
Emmanuel
Thank you! This is exactly what I was looking for.
All the best,
@emmanuelparadis:
Could you give an example of how exactly the rescaling of xl
and yl
would look like with these 6 networks when using layout()
?
Thanks a lot Nauras
Let's say you want to plot 3 networks on a single row (side by side), then find their respective values for 'xlim', store them in xl1
, xl2
, and xl3
:
widths <- c(diff(xl1), diff(xl1), diff(xl3)) / diff(xl1)
layout(matrix(1:6, 2, 3, byrow = TRUE), widths = widths)
If you want to plot them on a single column (stacked), you do the same but with 'ylim' and then setting 'heights' in layout()
.
When combining both, you have to be careful that 'heights' and 'widths' will (obviously) be the same for each row and column, respectively. So if the values of 'ylim' and 'xlim' are not the same within each row and column, that may not have the desired effect.
Merci ;-)
0
I've made haplotype networks in pegas according to: How to plot Pie charts in haploNet Haplotype Networks {pegas}
I am making multiple haplotype networks and would like the node sizes to be consistent across plots. Is there a way to fix this so that, for instance, a specific size node always means a single individual has that haplotype?
Thank you in advance!
The following is the code I use for each network.