I'm using seaborn to plot some biology data.
I just want a distribution one gene against another (expression in ~300 patients), and that's all worked fine and dandy with graph = sns.jointplot(x='Gene1',y='Gene2',data=data,kind='reg')
I like that the graph gives me a nice linear fit and a PearsonR and a P value.
All I want is to plot my data on a log scale, which is the way that such gene data is usually represented.
I've looked at a few solutions online, but they all get rid of my PearsonR value or my linear fit or they just don't look as good. I'm new to this, but it seems like graphing on a log scale shouldn't be too much trouble.
Any comments or solutions?
Thanks!
Edit: In response to comments, I've gotten closer to my answer. I now have a plot (shown below), but I need a line of fit and to do some statistics. Working on that now, but any answers/suggestions in the meantime are more than welcome.
mybins=np.logspace(0, np.log(100), 100)
g = sns.JointGrid(data1, data2, data, xlim=[.5, 1000000],
ylim=[.1, 10000000])
g.plot_marginals(sns.distplot, color='blue', bins=mybins)
g = g.plot(sns.regplot, sns.distplot)
g = g.annotate(stats.pearsonr)
ax = g.ax_joint
ax.set_xscale('log')
ax.set_yscale('log')
g.ax_marg_x.set_xscale('log')
g.ax_marg_y.set_yscale('log')
This worked just fine. In the end, I decided to just convert my table values into log(x)
, since that made the graph easier to scale and visualize in the short run.