Closed kellirichardson closed 2 years ago
It didn't actually have anything to do with the ggplot code, but rather the space the plot was allowed to take up in the Shiny app.
Feel free to adjust the height, but I'd leave the width at "100%" so the plot just fills the width of the browser window. You could try making the height a % instead of a pixel value (e.g. "80%" instead of "600px"), but just make sure you check what happens when you resize your window---the percentage is the percent of the browser window total height, I think.
Thank you! The spacing looks great on the interactive sankey we have here! We are including a static sankey (much smaller) in our manuscript, so I was going to see if the code you used for spacing could be used in the static sankey as well!
Ooh, so I think just changing the dimensions of the plot to make it taller should help. If you save the plot with ggsave()
you can do this fairly easily. E.g. to save a plot that's 10x5 inches as a .png:
p <- ggplot(.... code to make plot
ggsave("myplot.png", p, width = 10, height = 5, units = "in")
You might have to also make the labels smaller for it to look good. I'd be happy to help with that if you get stuck.
That worked!!! Thank you!
Two additional questions that I am struggling with (only if they are easy to answer):
I am happy to come to office hours as well for these additional questions!
Hey @Aariq ! I was looking through the code we have, and I am not seeing where you were able to get the node labels to space out/not overlap. Did you use code for this? If so, would this code work on a static sankey? (Thinking about the smaller sankey we are presenting in our manuscript).