I would like to compare the graphs, but my data seem to be not collebrated. How do I get them to the same base? That is I want them all to be "grounded" at the same level.
Example
Related
I would like to create a ggplot2 layer that includes multiple geom_bspline(), or something similar, to point to regions on different plots after combining them into a single figure. A feature in the data seen in one plot appears in another plot after a transformation. However, it may not be clear to a non-expert they are due to the same phenomenon. The plots are to be combined into a single figure using ggarrange(), cowplot(), patchwork() or something similar.
I can get by using ggforce::geom_ellipse() on each plot but it's not as clean. Any suggestions?
Of course, after asking the question and staring at the figure in question, it came to me that I simply need to add a geom_bspline() to the combined figure. Tried that earlier but didn't give enough thought to the coordinates on the new layer. The coordinates of the spline are given in the range of 0 to 1 for both the x and y values on this new layer. Simple and obvious.
I am preparing a figure for a paper presenting data for 2 different experiments in one plot. For that reason I don't need a legend for every plot, so I try to combine them with ggdraw from cowplot.
My code
should generate a reproducible example
and gives this output:
It seems like the two figures get the same slot (A) and the legend gets slot (B). Typically, I would probably use facet wrap to plot them together (which should also guarantee that the scaling/legend is consistent across the two plots.), but that will probably not work in this case, as I am trying to add an additional figure type to C and D.
The problem is that this figure type is ordinal so I have used a somewhat “hacky” approach to plot it, giving me this figure looking essentially as I want it to:
I so far have not been able to extract to another element that ggdraw can use.
Ideally the final plot should roughly look like this (of course with different labels):
How would you go about plotting these different types together?
Thank you for taking time to read my question and I hope that you can help me. I now it is quite a mouth full, but I was not sure how I meaningfully could reduce it to smaller chunks.
I have two cuffdiff outputs - by comparing the same control against two different experimental conditions.
I was wondering about the best tool in R that can be used to make a clustered heatmap which can show all three conditions (control and 2 experimentals) in the same plot
thanks
I have different time-series corresponding to different individuals and their location within a building (a categorical variable -- more like a room name).
I would like to study the similarity in movement of different individuals by something like cross-recurrence plots, where the two time-series correspond to the two axes and the actual points correspond to the presence/absence of individuals in the same room.
Has anyone tried doing such plots in R or while using ggplot? Any help would be great!
I haven't used this routine. I used only d2 dimension and Lyapunov exponent for EEG but this package Tisean (RTisean for your case) has a routine ['recurr'] that returns the specific plot.
This link has a nice wrap up of tutorials and links
Edited:
In this link you can find a nice example of application of recurrence plot.
The return variables of function recur(and similar functions of other packages) you can access after putting $ after the dataset (like database)
and you can access them inside in ggplot function and applying the appropriate aes.
I have a small data set consisting of two columns of data and a column designating which of the two sites the data was taken at. I have used xyplot to sort by groups, but I can't figure out how to alter the symbology of each group separately. I also need to add a regression line, and can only figure out how to do that in plot. What graphics package can give me these features in the same graph?
I have looked into different graphics packages to find one in which I can do everything I need, but I am new to R and am not having much luck.
ggplot2 is your go-to.
Try this:
install.packages('ggplot2')
library(ggplot2)
one=c("A","B","A","B")
two=c(1,2,3,4)
three=c(5,7,8,20)
df<-data.frame(one,two,three)
ggplot(df,aes(x=two,y=three,col=one))+geom_line()