Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PairGrid custom extent limits? #433

Open
shoyer opened this issue Jan 26, 2015 · 5 comments
Open

PairGrid custom extent limits? #433

shoyer opened this issue Jan 26, 2015 · 5 comments

Comments

@shoyer
Copy link
Contributor

shoyer commented Jan 26, 2015

It would be nice if PairGrid had some mechanism for specifying custom extent limits when the defaults aren't quite right, similar to the {x,y}lim arguments for FacetGrid.

I would normally do this after making a plot with matplotlib, but this is particularly awkward for PairGrid.

I imagine the API docs should look something this:

limits : dict of the form {variable: limits}, optional
    Axis limits of the form (vmin, vmax) for each named variable.
@mwaskom
Copy link
Owner

mwaskom commented Jan 27, 2015

This sounds like a good idea, I'm assuming you think it should be a parameter passed when instantiating a PairGrid?

@germannp
Copy link

germannp commented Feb 4, 2015

This would be particularly helpful, as there are problems in this context when using seaborn from python3. Or fixing might be possible in the same go.

Anyways, the following code will work in python2, but produce wrong axis with python3:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns


df = pd.DataFrame(np.random.rand(100,4))

g = sns.PairGrid(df)
# g.map(plt.scatter) # works in python3 too
g.map_diag(plt.hist)
g.map_offdiag(plt.scatter)

plt.show()

@mwaskom
Copy link
Owner

mwaskom commented Feb 4, 2015

Can you be more specific about what doesn't work and also check that you have the same seaborn and matplotlib versions in both environments? It's hard to understand what could differ between the python versions.

@germannp
Copy link

germannp commented Feb 4, 2015

I am sorry, my matplotlib for python3 was outdated ... Cheers & thanks for the good work!

@hectormz
Copy link

@mwaskom , @shoyer Is this issue still open and unsolved? It seems germannp's comments were unrelated.
I know you can adjust axes limits after creation and plotting pairgrids, but it'd be nice to initialize limits for each variable included. Or can this information be passed somehow for each variable in **kwargs if I want to use hist2d on map_upper() for example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants