8000 DOC: Fix some warnings in examples. · matplotlib/matplotlib@beb7282 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit beb7282

Browse files
committed
DOC: Fix some warnings in examples.
In `power_norm`, the input to `multivariate_normal` should be symmetric. In `scales`, the Mercator equation is ±inf for ±90, so change the limits to avoid that. In `demo_text_rotation_mode`, remove a deprecated call.
1 parent da6dfab commit beb7282

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/scales/power_norm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
data = np.vstack([
1616
multivariate_normal([10, 10], [[3, 2], [2, 3]], size=100000),
17-
multivariate_normal([30, 20], [[2, 3], [1, 3]], size=1000)
17+
multivariate_normal([30, 20], [[3, 1], [1, 3]], size=1000)
1818
])
1919

2020
gammas = [0.8, 0.5, 0.3]

examples/scales/scales.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ def inverse(a):
8787

8888
ax = axs[2, 1]
8989

90-
t = np.arange(-170.0, 170.0, 0.1)
90+
t = np.arange(0, 170.0, 0.1)
9191
s = t / 2.
9292

9393
ax.plot(t, s, '-', lw=2)
9494

9595
ax.set_yscale('function', functions=(forward, inverse))
9696
ax.set_title('function: Mercator')
9797
ax.grid(True)
98-
ax.set_xlim([-180, 180])
98+
ax.set_xlim([0, 180])
9999
ax.yaxis.set_minor_formatter(NullFormatter())
100-
ax.yaxis.set_major_locator(FixedLocator(np.arange(-90, 90, 30)))
100+
ax.yaxis.set_major_locator(FixedLocator(np.arange(0, 90, 10)))
101101

102102
plt.show()
103103

examples/text_labels_and_annotations/demo_text_rotation_mode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_rotation_mode(fig, mode, subplot_location):
6464
# highlight bbox
6565
fig.canvas.draw()
6666
for ax, tx in zip(grid, texts):
67-
bb = tx.get_window_extent().inverse_transformed(ax.transData)
67+
bb = tx.get_window_extent().transformed(ax.transData.inverted())
6868
rect = plt.Rectangle((bb.x0, bb.y0), bb.width, bb.height,
6969
facecolor="C1", alpha=0.3, zorder=2)
7070
ax.add_patch(rect)

0 commit comments

Comments
 (0)
0