0

I have this circular dendrogram in R and I want to zoom it. How can I proceed? Here it is: click here for dendrogram

The following code was used:

library(dendextend)
library(circlize)

load(file = "hc1.rda")
#out1 <- cutree(hc1, k = 50)
load(file = "out1.rda")

dend <- as.dendrogram(hc1)
dorder <- order.dendrogram(dend)

colrs = colorRampPalette(c("blue", "red"))(50)
#library(colorBrewer)
# modify the dendrogram to have some colors in the branches and labels
dend1 <- color_branches(dend, col=colrs , 
                        clusters=out1)
#plot(dend1)

# plot the radial plot
par(mar = rep(0,4))
   circlize_dendrogram(dend1, labels_track_height = NA, 
                    dend_track_height = .4, labels = FALSE) 
Marilou
  • 31
  • 8
  • What does "zoom it" mean exactly? What's your desired result? – MrFlick Dec 17 '18 at 17:52
  • It means that I want my graph to look bigger. – Marilou Dec 17 '18 at 17:55
  • 1
    Well, how are you looking at it now? With the image viewer in Rstudio? Just make the window bigger. – MrFlick Dec 17 '18 at 17:56
  • Yes, I did that but I want to have a bigger image using a code. I also noticed that the lines(branches) are too thin when I zoom it. It doesn't look great. – Marilou Dec 17 '18 at 17:59
  • Not of the code you've written here determines the size. The size is determined based on the output device you choose. Do you want to create a `pdf()` or `png()` or something? If you want to control the size, you'd need to write to a file. It looks like you [cannot set the size of the image view in Rstudio programmatically](https://support.rstudio.com/hc/en-us/community/posts/200847056-controlling-graphics-device-size-creating-new-window). It's still unclear exactly what you want in the end. – MrFlick Dec 17 '18 at 18:02
  • Yes, I know. I didn't write the code for the size. I want to create a pdf file :) – Marilou Dec 17 '18 at 18:05
  • Check out the `pdf()` function. It has options for `width=` and `size=` in inches so you can make the plot whatever size you like – MrFlick Dec 17 '18 at 19:09

1 Answers1

0

It is late but I tried another method for this problem. While exporting the image/pdf I have changed the dimensions usually multiple of 4. I hope so it will help.

Furqan
  • 59
  • 1
  • 8