seaborn
seaborn copied to clipboard
PairGrid custom extent limits?
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.
This sounds like a good idea, I'm assuming you think it should be a parameter passed when instantiating a PairGrid
?
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()
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.
I am sorry, my matplotlib for python3 was outdated ... Cheers & thanks for the good work!
@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