question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pairplot does not actually accept grid/axis argument

See original GitHub issue

This example I would expect to have two different scatter plots on each axis, but it only plots the first one:

import arviz as az

centered = az.load_arviz_data('centered')

axes, gridspec = az.plot_pair(
    centered.posterior, 
    var_names=['theta', 'mu'], 
    coords={'school': ['Choate', 'Deerfield']}, 
    plot_kwargs={'c': 'C0'})

az.plot_pair(
    centered.prior, 
    var_names=['theta', 'mu'], 
    coords={'school': ['Choate', 'Deerfield']}, 
    ax=axes, 
    gs=gridspec, 
    plot_kwargs={'c': 'C1'})

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MFreidankcommented, Oct 22, 2018

I think I’ll quickly fix this, settling for your first option above (remove those arguments). Three appears to be dangerous (as it will be hard to distinguish cases where axes are deleted etc, and that might lead to fairly hard-to-debug bugs), two might be added in the future, but essentially will also come down to first implementing the first option as far as I can tell.

0reactions
ColCarrollcommented, Oct 4, 2019

Thanks for checking – I just reran the initial code, and it now works with a little tweak:

centered = az.load_arviz_data('centered_eight')

axes = az.plot_pair(
    centered.posterior, 
    var_names=['theta', 'mu'], 
    coords={'school': ['Choate', 'Deerfield']}, 
    plot_kwargs={'c': 'C0'}, figsize=(15, 8))

az.plot_pair(
    centered.prior, 
    var_names=['theta', 'mu'], 
    coords={'school': ['Choate', 'Deerfield']}, 
    ax=axes, 
    plot_kwargs={'c': 'C1', 'alpha': 0.7})

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why seaborn's pairplot does not plot the first plot?
I know you've already accepted a solution. But if this can help someone in the future. It is worth mentioning. I saw a...
Read more >
Building structured multi-plot grids - Seaborn - PyData |
It must accept the data that it plots in positional arguments. Internally, FacetGrid will pass a Series of data for each of the...
Read more >
Making publication-quality figures in Python (Part I): Fig and ...
In this whole series, I will share with you how I usually make publication-quality figures in Python. I want to really convey the...
Read more >
How to make a pairplot in Python and the Seaborn ... - YouTube
I then discuss the kind of figures that can be used on a pairplot by changing the diag_kind or kind arguments : scatterplot,...
Read more >
Setting the size of a figure in matplotlib and seaborn
We can set the size by adding a figsize keyword argument to our pandas plot() function. The value has to be a tuple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found