8000 Merge branch 'matplotlib:main' into hasans-matplotlib/main · matplotlib/matplotlib@a7dc972 · GitHub
[go: up one dir, main page]

Skip to content

Commit a7dc972

Browse files
authored
Merge branch 'matplotlib:main' into hasans-matplotlib/main
2 parents 7547813 + 9a0b72a commit a7dc972

17 files changed

+39
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Passing inconsistent ``loc`` and ``nth_coord`` to axisartist helpers
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Trying to construct for example a "top y-axis" or a "left x-axis" is now
4+
deprecated.

examples/animation/animate_decay.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
88
- using a generator to drive an animation,
99
- changing axes limits during an animation.
10+
11+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1012
"""
1113

1214
import itertools

examples/animation/animated_histogram.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def animate(frame_number):
4545
# ``prepare_animation`` will define ``animate`` function working with supplied
4646
# `.BarContainer`, all this is used to setup `.FuncAnimation`.
4747

48+
# Output generate via `matplotlib.animation.Animation.to_jshtml`.
49+
4850
fig, ax = plt.subplots()
4951
_, _, bar_container = ax.hist(data, HIST_BINS, lw=1,
5052
ec="yellow", fc="green", alpha=0.5)

examples/animation/animation_demo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
examples that use it.
1111
1212
Note that calling `time.sleep` instead of `~.pyplot.pause` would *not* work.
13+
14+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1315
"""
1416

1517
import matplotlib.pyplot as plt

examples/animation/bayes_update.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
new data arrives.
88
The vertical line represents the theoretical value to which the plotted
99
distribution should converge.
10+
11+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1012
"""
1113

1214
import math

examples/animation/double_pendulum.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
88
Double pendulum formula translated from the C code at
99
http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c
10+
11+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1012
"""
1113

1214
from numpy import sin, cos

examples/animation/dynamic_image.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Animated image using a precomputed list of images
44
=================================================
55
6+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
67
"""
78

89
import numpy as np

examples/animation/frame_grabbing_sgskip.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Use a MovieWriter directly to grab individual frames and write them to a
77
file. This avoids any event loop integration, and thus works even with the Agg
88
backend. This is not recommended for use in an interactive setting.
9+
10+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
911
"""
1012

1113
import numpy as np

examples/animation/multiple_axes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
88
- how animation across multiple subplots works,
99
- using a figure artist in the animation.
10+
11+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1012
"""
1113

1214
import numpy as np

examples/animation/pause_resume.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
1616
You can copy and paste individual parts, or download the entire example
1717
using the link at the bottom of the page.
18+
19+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1820
"""
1921

2022
import matplotlib.pyplot as plt

examples/animation/rain.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
of 50 scatter points.
88
99
Author: Nicolas P. Rougier
10+
11+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1012
"""
1113

1214
import numpy as np

examples/animation/random_walk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Animated 3D random walk
44
=======================
55
6+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
67
"""
78

89
import numpy as np

examples/animation/simple_anim.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Animated line plot
44
==================
55
6+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
67
"""
78

89
import numpy as np

examples/animation/simple_scatter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Animated scatter saved as GIF
44
=============================
55
6+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
67
"""
78
import numpy as np
89
import matplotlib.pyplot as plt

examples/animation/strip_chart.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
============
55
66
Emulates an oscilloscope.
7+
8+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
79
"""
810

911
import numpy as np

examples/animation/unchained.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
(mostly known because of the cover for Joy Division's Unknown Pleasures).
88
99
Author: Nicolas P. Rougier
10+
11+
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1012
"""
1113

1214
import numpy as np

lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,17 @@ class Fixed(_Base):
126126

127127
def __init__(self, loc, nth_coord=None):
128128
"""``nth_coord = 0``: x-axis; ``nth_coord = 1``: y-axis."""
129-
_api.check_in_list(["left", "right", "bottom", "top"], loc=loc)
130-
self._loc = loc
131-
self._pos = {"bottom": 0, "top": 1, "left": 0, "right": 1}[loc]
132129
self.nth_coord = (
133130
nth_coord if nth_coord is not None else
134-
{"bottom": 0, "top": 0, "left": 1, "right": 1}[loc])
131+
_api.check_getitem(
132+
{"bottom": 0, "top": 0, "left": 1, "right": 1}, loc=loc))
133+
if (nth_coord == 0 and loc not in ["left", "right"]
134+
or nth_coord == 1 and loc not in ["bottom", "top"]):
135+
_api.warn_deprecated(
136+
"3.7", message=f"{loc=!r} is incompatible with "
137+
"{nth_coord=}; support is deprecated since %(since)s")
138+
self._loc = loc
139+
self._pos = {"bottom": 0, "top": 1, "left": 0, "right": 1}[loc]
135140
super().__init__()
136141
# axis line in transAxes
137142
self._path = Path(self._to_xy((0, 1), const=self._pos))

0 commit comments

Comments
 (0)
0