I'm using the densityplot function in flowViz to plot various channels of a flowSet.
densityplot(~., fs.gated.1, channels=c("deflog.V1", "deflog.Y2"), margin=FALSE, col="black")
How can I set the y-scale to be the same across all of the samples/flowframes? ylim sets the entire plot window, not the trace heights. I dug around in the lattice/xyplot/trellis options to try to find something there, but nothing worked. the "relation" option in "Common bivariate trellis plots"...
relation
A character string that determines how axis limits are calculated for each panel. Possible values are "same" (default), "free" and "sliced". For relation="same", the same limits, usually large enough to encompass all the data, are used for all the panels. For relation="free", limits for each panel is determined by just the points in that panel.
...appears to be exactly what I want (e.g. relation="same"), but this has no apparent effect on the densityplot function. Perhaps this is not an issue of axis scaling, but something in the way the density function is calculated and normalized?
Suggestions?
Seeing your syntax for this was informative for me, but ultimately this did not change the way the y-axis (or x, as you had typed) is plotted for each dataset in the flowframe. This appears to affect how the plot window for the two channels are treated, not the y-scale for the individual traces within each panel. In addition to "scales", I also tried as many alterations of limits, y, ylim, and prepanel, that I could think of. Nothing seems to change the ylim of the individual traces... only the channel-wide plot panel containing data from all flowframes of the set.
Can you try this very example code? Because it did it for me. Also I am confused that you kept saying y-axis since in densityplot y-axis is simply the sample name and doesn't seem to be relevant to what you are talking about here.
Thank you for your example, I did try it and play with it in an attempt to achieve my aims...
As a density plot (i.e. histogram) the y-axis to which I refer is the event count at each value of x. Yes, your example rescales the x axis, but leaves the y axis of each trace untouched, having a default of normalizing for each sample (row). In short, if you set overlap=0, you'll notice that every sample is scaled to the maximum row height (y-axis), regardless of the number of counts in that sample. Said another way, if two of your samples were simply a set of normally distributed values with n=100 and n=10,000, they would would appear exactly the same if plotted with this function. I wish to be able to distinguish these differences in population size by fixing the y-axis (event counts) for all samples plotted.