Hello. I’ve got stuck in plotting chart with seaborn.catplot(). I’m using the code below but both tests return error.
The code is hosted in repl.it.
Anyone can help on this? Thanks in advance.
fig = sns.catplot(
x = ‘variable’,
y = ‘total’,
col = ‘cardio’,
hue = ‘value’,
kind = ‘bar’,
data = df_cat
)
fig.set_axis_labels(‘variable’, ‘total’)
===========================================
ERROR: test_bar_plot_number_of_bars (test_module.CatPlotTestCase)
Traceback (most recent call last):
File “/home/runner/fcc-medical-data-visualizer/test_module.py”, line 26, in test_bar_plot_n
umber_of_bars
actual = len([rect for rect in self.ax.get_children() if isinstance(rect, mpl.patches.Rec
tangle)])
AttributeError: ‘numpy.ndarray’ object has no attribute ‘get_children’
==============================================
ERROR: test_line_plot_labels (test_module.CatPlotTestCase)
Traceback (most recent call last):
File “/home/runner/fcc-medical-data-visualizer/test_module.py”, line 13, in test_line_plot_labels
actual = self.ax.get_xlabel()
AttributeError: ‘numpy.ndarray’ object has no attribute ‘get_xlabel’