What I would like to do: I have a set of data organized by genotype along a categorical x axis. I would like to plot the population means with associated error bars set as standard errors of the mean in a pretty standard bar chart. I would also like to have, superimposed over my bar chart, each of the mean scores of the individual animals in my population as a strip plot (or scatter plot, I'm not picky). I can get this to work if I have a single set of named categorical axes on the x axis, but what I would really like to do is have two paired traces each attached to the x axes.
The dataframe looks like this:
>>> rotDF
ID Day Genotype Dose Direction Rotations
0 apple1 1 Del Sal Left 1
1 apple2 1 WT Sal Left 1
2 apple3 1 WT Sal Left 1
3 apple4 1 Del Sal Left 14
4 cherry1 1 Del Sal Left 3
Here's an example of the two things I want to combine. First, the ideal format of each trace of the bar graph would look like this:
First, I would like the bar charts to have their associated stripcharts superimposed over each of the bar traces.
Second, I would like each xaxis category to have the two color-coded traces organized around each ticklabel on the bottom, as in this bar chart.
Here's what I currently have. The bars look fine, but both sets of traces from the strip charts are clustered together at the middle, instead of being imposed over each of the bars for the respective trait. I have considered trying to color-code each data piece by genotype, which you can see in this version, but the dots cluster at the center rather than clustering alongside their assigned bar traces.
And here's what I want to achieve. This figure was created in inkscape using transparent copies of the strip plots superimposed on the relevant bar plots. It's not ideal, but it worked for last conference--but I would really love to see something better.
from How do I superimpose strip plots over bar charts in plotly?
No comments:
Post a Comment