Skip to content

Commit bd8cb1e

Browse files
committed
Clean and fix links in moved examples
1 parent 9319970 commit bd8cb1e

File tree

8 files changed

+36
-35
lines changed

8 files changed

+36
-35
lines changed

examples/lines_bars_and_markers/simple_plot.py

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

1111
# Data for plotting
1212
t = np.arange(0.0, 2.0, 0.01)
13-
s = 1 + np.sin(2*np.pi*t)
13+
s = 1 + np.sin(2 * np.pi * t)
1414

1515
# Note that using plt.subplots below is equivalent to using
1616
# fig = plt.figure and then ax = fig.add_subplot(111)

examples/misc/table_demo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
import matplotlib.pyplot as plt
1010

1111

12-
data = [[ 66386, 174296, 75131, 577908, 32015],
13-
[ 58230, 381139, 78045, 99308, 160454],
14-
[ 89135, 80552, 152558, 497981, 603535],
15-
[ 78415, 81858, 150656, 193263, 69638],
16-
[ 139361, 331509, 343164, 781380, 52269]]
12+
data = [[66386, 174296, 75131, 577908, 32015],
13+
[58230, 381139, 78045, 99308, 160454],
14+
[89135, 80552, 152558, 497981, 603535],
15+
[78415, 81858, 150656, 193263, 69638],
16+
[139361, 331509, 343164, 781380, 52269]]
1717

1818
columns = ('Freeze', 'Wind', 'Flood', 'Quake', 'Hail')
1919
rows = ['%d year' % x for x in (100, 50, 20, 10, 5)]
@@ -36,7 +36,7 @@
3636
for row in range(n_rows):
3737
plt.bar(index, data[row], bar_width, bottom=y_offset, color=colors[row])
3838
y_offset = y_offset + data[row]
39-
cell_text.append(['%1.1f' % (x/1000.0) for x in y_offset])
39+
cell_text.append(['%1.1f' % (x / 1000.0) for x in y_offset])
4040
# Reverse colors and text labels to display the last value at the top.
4141
colors = colors[::-1]
4242
cell_text.reverse()

examples/pie_and_polar_charts/polar_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
ax = plt.subplot(111, projection='polar')
1616
ax.plot(theta, r)
1717
ax.set_rmax(2)
18-
ax.set_rticks([0.5, 1, 1.5, 2]) # less radial ticks
19-
ax.set_rlabel_position(-22.5) # get radial labels away from plotted line
18+
ax.set_rticks([0.5, 1, 1.5, 2]) # Less radial ticks
19+
ax.set_rlabel_position(-22.5) # Move radial labels away from plotted line
2020
ax.grid(True)
2121

2222
ax.set_title("A line plot on a polar axis", va='bottom')

examples/scales/log_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
fig.subplots_adjust(hspace=0.5)
2121

2222
# log y axis
23-
ax1.semilogy(t, np.exp(-t/5.0))
23+
ax1.semilogy(t, np.exp(-t / 5.0))
2424
ax1.set(title='semilogy')
2525
ax1.grid()
2626

2727
# log x axis
28-
ax2.semilogx(t, np.sin(2*np.pi*t))
28+
ax2.semilogx(t, np.sin(2 * np.pi * t))
2929
ax2.set(title='semilogx')
3030
ax2.grid()
3131

3232
# log x and y axis
33-
ax3.loglog(t, 20*np.exp(-t/10.0), basex=2)
33+
ax3.loglog(t, 20 * np.exp(-t / 10.0), basex=2)
3434
ax3.set(title='loglog base 2 on x')
3535
ax3.grid()
3636

@@ -42,7 +42,7 @@
4242
ax4.set_xscale("log", nonposx='clip')
4343
ax4.set_yscale("log", nonposy='clip')
4444
ax4.set(title='Errorbars go negative')
45-
ax4.errorbar(x, y, xerr=0.1*x, yerr=5.0 + 0.75*y)
45+
ax4.errorbar(x, y, xerr=0.1 * x, yerr=5.0 + 0.75 * y)
4646
# ylim must be set after errorbar to allow errorbar to autoscale limits
4747
ax4.set_ylim(ymin=0.1)
4848

examples/shapes_and_collections/ellipse_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
NUM = 250
1212

13-
ells = [Ellipse(xy=np.random.rand(2)*10,
13+
ells = [Ellipse(xy=np.random.rand(2) * 10,
1414
width=np.random.rand(), height=np.random.rand(),
15-
angle=np.random.rand()*360)
15+
angle=np.random.rand() * 360)
1616
for i in range(NUM)]
1717

1818
fig, ax = plt.subplots(subplot_kw={'aspect': 'equal'})

examples/shapes_and_collections/fancybox_demo.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
spacing = 1.2
2121

2222
figheight = (spacing * len(styles) + .5)
23-
fig1 = plt.figure(1, (4/1.5, figheight/1.5))
23+
fig1 = plt.figure(1, (4 / 1.5, figheight / 1.5))
2424
fontsize = 0.3 * 72
2525

2626
for i, stylename in enumerate(sorted(styles)):
@@ -65,8 +65,8 @@ def test1(ax):
6565
size=10, transform=ax.transAxes)
6666

6767
# draws control points for the fancy box.
68-
#l = p_fancy.get_path().vertices
69-
#ax.plot(l[:,0], l[:,1], ".")
68+
# l = p_fancy.get_path().vertices
69+
# ax.plot(l[:,0], l[:,1], ".")
7070

7171
# draw the original bbox in black
7272
draw_bbox(ax, bb)
@@ -90,15 +90,15 @@ def test2(ax):
9090

9191
p_fancy.set_boxstyle("round,pad=0.1, rounding_size=0.2")
9292
# or
93-
#p_fancy.set_boxstyle("round", pad=0.1, rounding_size=0.2)
93+
# p_fancy.set_boxstyle("round", pad=0.1, rounding_size=0.2)
9494

9595
ax.text(0.1, 0.8,
9696
' boxstyle="round,pad=0.1\n rounding_size=0.2"',
9797
size=10, transform=ax.transAxes)
9898

9999
# draws control points for the fancy box.
100-
#l = p_fancy.get_path().vertices
101-
#ax.plot(l[:,0], l[:,1], ".")
100+
# l = p_fancy.get_path().vertices
101+
# ax.plot(l[:,0], l[:,1], ".")
102102

103103
draw_bbox(ax, bb)
104104

@@ -122,8 +122,8 @@ def test3(ax):
122122
size=10, transform=ax.transAxes)
123123

124124
# draws control points for the fancy box.
125-
#l = p_fancy.get_path().vertices
126-
#ax.plot(l[:,0], l[:,1], ".")
125+
# l = p_fancy.get_path().vertices
126+
# ax.plot(l[:,0], l[:,1], ".")
127127

128128
draw_bbox(ax, bb)
129129

@@ -192,4 +192,5 @@ def test_all():
192192
plt.draw()
193193
plt.show()
194194

195+
195196
test_all()

tutorials/01_introductory/sample_plots.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
Here's how to create a line plot with text labels using
1515
:func:`~matplotlib.pyplot.plot`.
1616
17-
.. figure:: ../../gallery/pylab_examples/images/sphx_glr_simple_plot_001.png
18-
:target: ../../gallery/pylab_examples/simple_plot.html
17+
.. figure:: ../../gallery/lines_bars_and_markers/images/sphx_glr_simple_plot_001.png
18+
:target: ../../gallery/lines_bars_and_markers/simple_plot.html
1919
:align: center
2020
:scale: 50
2121
@@ -120,8 +120,8 @@
120120
accurate 8-spline approximation to elliptical arcs (see
121121
:class:`~matplotlib.patches.Arc`), which are insensitive to zoom level.
122122
123-
.. figure:: ../../gallery/pylab_examples/images/sphx_glr_ellipse_demo_001.png
124-
:target: ../../gallery/pylab_examples/ellipse_demo.html
123+
.. figure:: ../../gallery/shapes_and_collections/images/sphx_glr_ellipse_demo_001.png
124+
:target: ../../gallery/shapes_and_collections/ellipse_demo.html
125125
:align: center
126126
:scale: 50
127127
@@ -174,8 +174,8 @@
174174
The :func:`~matplotlib.pyplot.table` command adds a text table
175175
to an axes.
176176
177-
.. figure:: ../../gallery/pylab_examples/images/sphx_glr_table_demo_001.png
178-
:target: ../../gallery/pylab_examples/table_demo.html
177+
.. figure:: ../../gallery/misc/images/sphx_glr_table_demo_001.png
178+
:target: ../../gallery/misc/table_demo.html
179179
:align: center
180180
:scale: 50
181181
@@ -265,8 +265,8 @@
265265
:func:`~matplotlib.pyplot.loglog` functions simplify the creation of
266266
logarithmic plots.
267267
268-
.. figure:: ../../gallery/pylab_examples/images/sphx_glr_log_demo_001.png
269-
:target: ../../gallery/pylab_examples/log_demo.html
268+
.. figure:: ../../gallery/scales/images/sphx_glr_log_demo_001.png
269+
:target: ../../gallery/scales/log_demo.html
270270
:align: center
271271
:scale: 50
272272
@@ -282,8 +282,8 @@
282282
283283
The :func:`~matplotlib.pyplot.polar` command generates polar plots.
284284
285-
.. figure:: ../../gallery/pylab_examples/images/sphx_glr_polar_demo_001.png
286-
:target: ../../gallery/pylab_examples/polar_demo.html
285+
.. figure:: ../../gallery/pie_and_polar_charts/images/sphx_glr_polar_demo_001.png
286+
:target: ../../gallery/pie_and_polar_charts/polar_demo.html
287287
:align: center
288288
:scale: 50
289289

tutorials/text/annotations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@
158158
Square ``square`` pad=0.3
159159
========== ============== ==========================
160160
161-
.. figure:: ../../gallery/pylab_examples/images/sphx_glr_fancybox_demo_001.png
162-
:target: ../../gallery/pylab_examples/fancybox_demo.html
161+
.. figure:: ../../gallery/shapes_and_collections/images/sphx_glr_fancybox_demo_001.png
162+
:target: ../../gallery/shapes_and_collections/fancybox_demo.html
163163
:align: center
164164
:scale: 50
165165

0 commit comments

Comments
 (0)