chalie001
asked on
error in python
hi am geting this error
g.map(sns.distplot,'total_ bill')
ValueError Traceback (most recent call last)
<ipython-input-17-70f4ea00 c4cc> in <module>
----> 1 g.map(sns.distplot,'total_ bill')
C:\ProgramData\Anaconda3\l ib\site-pa ckages\sea born\axisg rid.py in map(self, func, *args, **kwargs)
728
729 # Get the current axis
--> 730 ax = self.facet_axis(row_i, col_j)
731
732 # Decide what color to plot with
C:\ProgramData\Anaconda3\l ib\site-pa ckages\sea born\axisg rid.py in facet_axis(self, row_i, col_j)
858
859 # Get a reference to the axes object we want, and make it active
--> 860 plt.sca(ax)
861 return ax
862
C:\ProgramData\Anaconda3\l ib\site-pa ckages\mat plotlib\py plot.py in sca(ax)
912 m.canvas.figure.sca(ax)
913 return
--> 914 raise ValueError("Axes instance argument was not found in a figure")
915
916
ValueError: Axes instance argument was not found in a figure
g.map(sns.distplot,'total_
ValueError Traceback (most recent call last)
<ipython-input-17-70f4ea00
----> 1 g.map(sns.distplot,'total_
C:\ProgramData\Anaconda3\l
728
729 # Get the current axis
--> 730 ax = self.facet_axis(row_i, col_j)
731
732 # Decide what color to plot with
C:\ProgramData\Anaconda3\l
858
859 # Get a reference to the axes object we want, and make it active
--> 860 plt.sca(ax)
861 return ax
862
C:\ProgramData\Anaconda3\l
912 m.canvas.figure.sca(ax)
913 return
--> 914 raise ValueError("Axes instance argument was not found in a figure")
915
916
ValueError: Axes instance argument was not found in a figure
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i did this
grid.ipynb
grid.ipynb
ASKER
i add this
g = sns.FacetGrid(data=tips,col='time',row='smoker')
g.map(sns.distplot,'total_bill')
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The error messages & a few lines in some library or object are complete without any context.
It would be wise to create a little reproducer (the smallest code / abstract from your code), that
behaves the same as your program w.r.t. the problem, yet is does compile / run on its own.
The problem is explained by the library that needs to plot something. It tells you: your forgot the Axes part....
Where do you guess the error can be found?....
In your code there apparently is something missing w.r.t. axes definitions.