8000 curly brackets dict · matplotlib/matplotlib@a24ca89 · GitHub
[go: up one dir, main page]

Skip to content

Commit a24ca89

Browse files
committed
curly brackets dict
1 parent c3f5715 commit a24ca89

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/misc/keyword_plotting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import matplotlib.pyplot as plt
1717
np.random.seed(19680801)
1818

19-
data = dict([('a', np.arange(50)),
20-
('c', np.random.randint(0, 50, 50)),
21-
('d', np.random.randn(50))])
19+
data = {'a': np.arange(50),
20+
'c': np.random.randint(0, 50, 50),
21+
'd': np.random.randn(50)}
2222
data['b'] = data['a'] + 10 * np.random.randn(50)
2323
data['d'] = np.abs(data['d']) * 100
2424

tutorials/01_introductory/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@
107107
# the ``data`` keyword argument. If provided, then you may generate plots with
108108
# the strings corresponding to these variables.
109109

110-
data = dict([('a', np.arange(50)),
111-
('c', np.random.randint(0, 50, 50)),
112-
('d', np.random.randn(50))])
110+
data = {'a': np.arange(50),
111+
'c': np.random.randint(0, 50, 50),
112+
'd': np.random.randn(50)}
113113
data['b'] = data['a'] + 10 * np.random.randn(50)
114114
data['d'] = np.abs(data['d']) * 100
115115

116-
plt.plot('a', 'b', color='c', data=data)
116+
plt.plot('a', 'b', color='c', s='d', data=data)
117117
plt.xlabel('a')
118118
plt.ylabel('b')
119119
plt.show()

0 commit comments

Comments
 (0)
0