Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b520f86 commit 24e9946Copy full SHA for 24e9946
1 file changed
lib/matplotlib/tests/test_axes.py
@@ -9902,12 +9902,14 @@ def test_pie_all_zeros():
9902
ax.pie([0, 0], labels=["A", "B"])
9903
9904
9905
-def test_set_axes_with_none_limits():
+def test_get_legend_return_type():
9906
fig, ax = plt.subplots()
9907
- xlim_before = ax.get_xlim()
9908
- ylim_before = ax.get_ylim()
9909
9910
- ax.set(xlim=None, ylim=None)
+ assert ax.get_legend() is None
9911
9912
- assert ax.get_xlim() == xlim_before
9913
- assert ax.get_ylim() == ylim_before
+ ax.plot([1, 2], label="Line")
+ ax.legend()
+
+ legend = ax.get_legend()
9914
+ assert legend is not None
9915
+ assert isinstance(legend, matplotlib.legend.Legend)
0 commit comments