diff --git a/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.pdf b/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.pdf new file mode 100644 index 000000000000..dfc06c42b71b Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.pdf differ diff --git a/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.png b/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.png new file mode 100644 index 000000000000..34f1c4d951d8 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.svg b/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.svg new file mode 100644 index 000000000000..455b5fd9abe1 --- /dev/null +++ b/lib/matplotlib/tests/baseline_images/test_legend/legend_auto3.svg @@ -0,0 +1,607 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py index f192fb4b23af..cc8e589db2b7 100644 --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -26,6 +26,19 @@ def test_legend_auto2(): ax.legend([b1[0], b2[0]], ['up', 'down'], loc=0) +@image_comparison(baseline_images=['legend_auto3']) +def test_legend_auto3(): + 'Test automatic legend placement' + fig = plt.figure() + ax = fig.add_subplot(111) + x = [0.9, 0.1, 0.1, 0.9, 0.9, 0.5] + y = [0.95, 0.95, 0.05, 0.05, 0.5, 0.5] + ax.plot(x, y, 'o-', label='line') + ax.set_xlim(0.0, 1.0) + ax.set_ylim(0.0, 1.0) + ax.legend(loc=0) + + @image_comparison(baseline_images=['legend_various_labels'], remove_text=True) def test_various_labels(): # tests all sorts of label types