Skip to content

Commit f8ac793

Browse files
committed
Small example fixes
1 parent 6e9e271 commit f8ac793

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/color/color_demo.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
import matplotlib.pyplot as plt
2323
import numpy as np
2424

25-
fig, ax = plt.subplots(facecolor='darkslategray')
2625
t = np.arange(0.0, 2.0, 0.01)
2726
s = np.sin(2 * np.pi * t)
27+
28+
fig, ax = plt.subplots(facecolor='darkslategray')
2829
ax.plot(t, s, 'C1')
2930
ax.set_xlabel('time (s)', color='C1')
3031
ax.set_ylabel('voltage (mV)', color='0.5') # grayscale color

examples/lines_bars_and_markers/scatter_custom_symbol.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
66
"""
77
import matplotlib.pyplot as plt
8-
from numpy import arange, pi, cos, sin
9-
from numpy.random import rand
8+
import numpy as np
109

1110
# unit area ellipse
1211
rx, ry = 3., 1.
13-
area = rx * ry * pi
14-
theta = arange(0, 2 * pi + 0.01, 0.1)
15-
verts = list(zip(rx / area * cos(theta), ry / area * sin(theta)))
12+
area = rx * ry * np.pi
13+
theta = np.arange(0, 2 * np.pi + 0.01, 0.1)
14+
verts = list(zip(rx / area * np.cos(theta), ry / area * np.sin(theta)))
1615

17-
x, y, s, c = rand(4, 30)
16+
x, y, s, c = np.random.rand(4, 30)
1817
s *= 10**2.
1918

2019
fig, ax = plt.subplots()

examples/lines_bars_and_markers/scatter_star_poly.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
plt.subplot(323)
2626
plt.scatter(x, y, s=80, c=z, marker=(verts, 0))
2727
# equivalent:
28-
# plt.scatter(x,y,s=80, c=z, marker=None, verts=verts)
28+
# plt.scatter(x, y, s=80, c=z, marker=None, verts=verts)
2929

3030
plt.subplot(324)
3131
plt.scatter(x, y, s=80, c=z, marker=(5, 1))

0 commit comments

Comments
 (0)