olgabot/prettyplotlib

colorbar behavior when using subplots

Closed this issue · 3 comments

When I use the pcolormesh function many times inside suplots, all the color bars appear until the end of the plot. See figure
pcolormesh

Thanks

Cesar, thanks for pointing this out. What is your desired outcome? That
each subplot have its own colorbar, or that there's one at the end?


Olga Botvinnik
PhD Program in Bioinformatics and Systems Biology
Gene Yeo Laboratory http://yeolab.ucsd.edu/yeolab/Home.html | Sanford
Consortium for Regenerative Medicine
University of California, San Diego
www http://olgabotvinnik.com | blog http://blog.olgabotvinnik.com/ |
github http://github.com/olgabot | twitter http://twitter.com/olgabot |
linkedin http://www.linkedin.com/in/olgabotvinnik

On Wed, Mar 19, 2014 at 8:22 AM, Cesar Flores notifications@github.comwrote:

When I use the pcolormesh function many times inside suplots, all the
color bars appear until the end of the plot. See figure
[image: pcolormesh]https://f.cloud.github.com/assets/894051/2461761/3180ac92-af7a-11e3-9e34-c01a6a594578.png

Thanks

Reply to this email directly or view it on GitHubhttps://github.com//issues/47
.

I feel I figure out by changing the next lines of your _pcolormesh.py:

fig.colorbar(p, cax=ax_colorbar, use_gridspec=True,
             orientation=orientation_colorbar)

by:

fig.colorbar(p, ax=ax_colorbar, use_gridspec=True,
             orientation=orientation_colorbar)

Somehow cax shows very small colorbars. It will be nice to add an extra flag that makes the fig.colorbar call optional.

Thanks a lot

Thank you for your comment. Unfortunately, I no longer have the bandwidth to maintain prettyplotlib. I recommend using seaborn. Using seaborn, to get the prettyplotlib style, do:

import seaborn as sns
sns.set(style='ticks', palette='Set2')

And to remove "chartjunk", do:

sns.despine()

If you have discrete pull requests, I will accept them, but I personally will no longer fix bugs.

If you are a biological scientist looking for ways to analyze your big-ish (20+ samples) data, check out my main project, flotilla.