gtable Questions
2
Solved
In plots with multiple facet variables, ggplot2 repeats the facet label for the "outer" variable, rather than having a single spanning facet strip across all the levels of the "inner" variable. I h...
2
Solved
I have been trying to extend my scenario from here to make use of facets (specifically facet_grid()).
I have seen this example, however I can't seem to get it to work for my geom_bar() and geom_po...
1
Solved
I am using facet_wrap and was also able to plot the secondary y-axis. However the labels are not getting plotted near the axis, rather they are plotted very far. I realise it all will get resolved ...
2
Solved
I can't get the answer to this question to work.
What both me and that user want is to add axis ticks and labels to all columns when using facet_grid().
Display y-axis for each subplot when face...
Mila asked 3/6, 2016 at 16:40
2
Solved
I am creating a graphic using facet_grid to facet a categorical variable on the y-axis. I decided not to use facet_wrap because I need space = 'free' and labeller = label_parsed. My labels are long...
1
Solved
For a publication I need to add a second y-axis to an existing plot. I've come across a means of how to do this (https://rpubs.com/kohske/dual_axis_in_ggplot2). However, I don't really understand m...
4
Since I have updated to ggplot2 2.0.0, I cannot arrange charts propperly using gridExtra. The issue is that the faceted charts will get compressed while other will expand. The widths are basically ...
1
I have been trying to make a 2 to 3-line figure caption below the combined plots using the following script:
library(grid)
library(gridExtra)
library(ggplot2)
g1 <- ggplotGrob(pl) #pl is my pl...
2
First of all I would like to thank Sir Baptiste for helping me improve my R script by adding a caption at the bottom left the of the combined plots using gtable/textGrob as shown below:
library(gr...
3
Solved
I am attempting to use grobs and gtable to arrange 4 (ggplot2) plots into a 2x2 grid. I don't know how to set widths, and also a non- 1xn, or nx1 arrangement.
Using this code:
data(iris)
a <- ...
5
Solved
I'm working with the really awesome library ggplot2. I figured out how to set the aspect ratio of a plot by using coord_fixed. Now, I'd like to save the plot to a PDF with a specified width (e.g 10...
2
Solved
I have been attempting this for quite sometime today and still haven't been able to align two different chart types together by their X axis which are the same. I simply need a double line chart on...
1
At How can I put a transformed scale on the right side of a ggplot2? it was shown how to add two y-axis in the same plot by manipulation and merging ggplot2 objects with gtable.
From the example th...
1
Solved
I have arranged two plots: a line chart on top and a heatmap below.
I want the heatmap legend to have the same height as the plot area of the heatmap, i.e. the same length as the y-axis. I know th...
1
Solved
I am learning to manipulate ggplot objects with gtable. [Here is a related question I asked: dismantling a ggplot with grid and gtable ]
The present issue is:
how to take various axis elements f...
1
Solved
I'm struggling to build a dual-axis plot based on ggplot objects. At baptiste's suggestion, I have broken down the problem into smaller parts. The present issue is:
how to remove all of the data ...
1
Solved
I am trying to compose a dual y-axis chart using ggplot. Firstly let me say that I am not looking for a discussion on the merits of whether or not it is good practice to do so. I find them to be pa...
Whereinto asked 4/11, 2014 at 4:24
1
Solved
I am trying to create an arrangement of three scatterplots with shared axes and marginal histograms. This seems like it should be simple, but it's giving me fits. I have tried approaches with gridE...
2
Solved
Is there an elegant way to align the tableGrob rows with the axis breaks?
I would like to juxtapose a tableGrob and ggplot chart in R (I need to reproduce some SAS output used in previous versions...
5
Solved
It's relatively simple using grid.arrange in the gridExtra package to arrange multiple plots in a matrix, but how can you arrange plots (the ones I'm working on are from ggplot2) when some plots ar...
1
Solved
QUESTION
How do you combine separate plots (ggplot2), with different y-axis and different plot heights, yet retain alignment?
DETAIL
When combining plots with grid.arrange (method1), with diffe...
1
I have two ggplot geom_tile plots that I put together using grid.arrange() from the gridExtra library. This is the result
library(ggplot2)
library(plyr)
p3 <- ggplot2(...)
p4 <- ggplot2(......
2
Solved
Using unit.pmax as the default comparison of widths/heights in gtable is proving harder than I'd hoped; after several hours of head scratching I've narrowed it down to this situation:
library(grid...
1
Solved
I want to add a facet title as strip over a facetted plot in ggplot2. My MWE throws an error.
library(ggplot2)
library(gtable)
p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
p <- p + facet...
1
I am trying to produce png file of ggplot objects with transparent backgrounds. When I was using the ggplot objects directly with panel.background=element_rect(fill = "transparent",colour = NA) I w...
© 2022 - 2024 — McMap. All rights reserved.