Skip to content

Commit

Permalink
Backport PR matplotlib#14806: Remove unnecessary uses of transFigure …
Browse files Browse the repository at this point in the history
…from examples.
  • Loading branch information
timhoffm authored and MeeseeksDev[bot] committed Jul 17, 2019
1 parent 9a5473d commit 00f6f0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
7 changes: 3 additions & 4 deletions examples/pyplots/fig_x.py
Expand Up @@ -5,15 +5,14 @@
Adding lines to a figure without any axes.
"""

import matplotlib.pyplot as plt
import matplotlib.lines as lines


fig = plt.figure()
l1 = lines.Line2D([0, 1], [0, 1], transform=fig.transFigure, figure=fig)
l2 = lines.Line2D([0, 1], [1, 0], transform=fig.transFigure, figure=fig)
fig.lines.extend([l1, l2])

fig.add_artist(lines.Line2D([0, 1], [0, 1]))
fig.add_artist(lines.Line2D([0, 1], [1, 0]))
plt.show()

#############################################################################
Expand Down
19 changes: 8 additions & 11 deletions examples/shapes_and_collections/fancybox_demo.py
@@ -1,13 +1,11 @@
"""
=============
Fancybox Demo
=============
===================
Drawing fancy boxes
===================
Plotting fancy boxes with Matplotlib.
The following examples show how to plot boxes with different
visual properties.
The following examples show how to plot boxes with different visual properties.
"""

import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
import matplotlib.patches as mpatch
Expand All @@ -25,10 +23,9 @@

for i, stylename in enumerate(sorted(styles)):
fig.text(0.5, (spacing * (len(styles) - i) - 0.5) / figheight, stylename,
ha="center",
size=fontsize,
transform=fig.transFigure,
bbox=dict(boxstyle=stylename, fc="w", ec="k"))
ha="center",
size=fontsize,
bbox=dict(boxstyle=stylename, fc="w", ec="k"))

plt.show()

Expand Down

0 comments on commit 00f6f0d

Please sign in to comment.