Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4513182 commit 09b29d8Copy full SHA for 09b29d8
47 files changed
examples/api/demo_affine_image.py
100644
100755
@@ -37,7 +37,7 @@ def imshow_affine(ax, z, *kl, **kwargs):
37
38
fig, (ax1, ax2) = plt.subplots(1, 2)
39
Z = get_image()
40
- im1 = imshow_affine(ax1, Z, interpolation='none', cmap=cm.jet,
+ im1 = imshow_affine(ax1, Z, interpolation='none',
41
origin='lower',
42
extent=[-2, 4, -3, 2], clip_on=True)
43
@@ -48,15 +48,15 @@ def imshow_affine(ax, z, *kl, **kwargs):
48
x1, x2, y1, y2 = im1.get_extent()
49
x3, y3 = x2, y1
50
51
- ax1.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "r--", lw=3,
+ ax1.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "--",
52
transform=trans_data2)
53
54
ax1.set_xlim(-3, 5)
55
ax1.set_ylim(-4, 4)
56
57
# image skew
58
59
- im2 = ax2.imshow(Z, interpolation='none', cmap=cm.jet,
+ im2 = ax2.imshow(Z, interpolation='none',
60
61
62
im2._image_skew_coordinate = (3, -2)
examples/api/filled_step.py
@@ -61,9 +61,11 @@ def filled_hist(ax, edges, values, bottoms=None, orientation='v',
values = np.r_[values, values[-1]]
bottoms = np.r_[bottoms, bottoms[-1]]
63
if orientation == 'h':
64
- return ax.fill_betweenx(edges, values, bottoms, **kwargs)
+ return ax.fill_betweenx(edges, values, bottoms, left_margin=False,
65
+ **kwargs)
66
elif orientation == 'v':
- return ax.fill_between(edges, values, bottoms, **kwargs)
67
+ return ax.fill_between(edges, values, bottoms, bottom_margin=False,
68
69
else:
70
raise AssertionError("you should never be here")
71
@@ -206,3 +208,5 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
206
208
ax1.set_xlabel('counts')
207
209
ax1.set_ylabel('x')
210
ax2.set_ylabel('x')
211
+
212
+plt.show()
examples/api/histogram_path_demo.py
@@ -36,8 +36,7 @@
36
barpath = path.Path.make_compound_path_from_polys(XY)
# make a patch out of it
-patch = patches.PathPatch(
- barpath, facecolor='blue', edgecolor='gray', alpha=0.8)
+patch = patches.PathPatch(barpath, facecolor='blue')
ax.add_patch(patch)
# update the view limits
examples/api/image_zcoord.py
@@ -9,7 +9,7 @@
9
X = 10*np.random.rand(5, 3)
10
11
fig, ax = plt.subplots()
12
-ax.imshow(X, cmap=cm.jet, interpolation='nearest')
+ax.imshow(X, interpolation='nearest')
13
14
numrows, numcols = X.shape
15
examples/api/patch_collection.py
@@ -39,7 +39,7 @@
patches.append(polygon)
colors = 100*np.random.rand(len(patches))
-p = PatchCollection(patches, cmap=matplotlib.cm.jet, alpha=0.4)
+p = PatchCollection(patches, alpha=0.4)
p.set_array(np.array(colors))
44
ax.add_collection(p)
45
plt.colorbar(p)
examples/api/power_norm_demo.py
@@ -19,9 +19,10 @@
19
20
for i, gamma in enumerate(gammas):
21
plt.subplot(xgrid, ygrid, i + 2)
22
- plt.title('Power law normalization\n$(\gamma=%1.1f)$' % gamma)
+ plt.title('Power law\n$(\gamma=%1.1f)$' % gamma)
23
plt.hist2d(data[:, 0], data[:, 1],
24
bins=100, norm=mcolors.PowerNorm(gamma))
25
26
-plt.subplots_adjust(hspace=0.39)
+plt.subplots_adjust(hspace=0.8)
27
+plt.savefig("test.png")
28
plt.show()
examples/api/sankey_demo_basics.py
@@ -42,10 +42,8 @@
orientations=[-1, 1, 0, 1, 1, 1, -1, -1, 0],
pathlengths=[0.25, 0.25, 0.25, 0.25, 0.25, 0.6, 0.25, 0.25,
0.25],
- patchlabel="Widget\nA",
46
- alpha=0.2, lw=2.0) # Arguments to matplotlib.patches.PathPatch()
+ patchlabel="Widget\nA") # Arguments to matplotlib.patches.PathPatch()
47
diagrams = sankey.finish()
-diagrams[0].patch.set_facecolor('#37c959')
diagrams[0].texts[-1].set_color('r')
diagrams[0].text.set_fontweight('bold')
# Notice:
@@ -66,7 +64,7 @@
sankey = Sankey(ax=ax, unit=None)
sankey.add(flows=flows, label='one',
orientations=[-1, 1, 0, 1, 1, 1, -1, -1, 0])
-sankey.add(flows=[-0.25, 0.15, 0.1], fc='#37c959', label='two',
+sankey.add(flows=[-0.25, 0.15, 0.1], label='two',
orientations=[-1, -1, -1], prior=0, connect=(0, 0))
72
diagrams[-1].patch.set_hatch('/')
examples/api/sankey_demo_links.py
@@ -12,13 +12,12 @@
def side(sankey, n=1):
"""Generate a side chain."""
prior = len(sankey.diagrams)
- colors = cycle(['orange', 'b', 'g', 'r', 'c', 'm', 'y'])
16
for i in range(0, 2*n, 2):
17
sankey.add(flows=[1, -1], orientations=[-1, -1],
18
- patchlabel=str(prior + i), facecolor=next(colors),
+ patchlabel=str(prior + i),
prior=prior + i - 1, connect=(1, 0), alpha=0.5)
sankey.add(flows=[1, -1], orientations=[1, 1],
- patchlabel=str(prior + i + 1), facecolor=next(colors),
+ patchlabel=str(prior + i + 1),
prior=prior + i, connect=(1, 0), alpha=0.5)
examples/api/sankey_demo_old.py
@@ -187,7 +187,7 @@ def put_labels(labels, positions, output=True):
187
188
patch, (intexts, outtexts) = sankey(ax, outputs=outputs,
189
outlabels=outlabels, inputs=inputs,
190
- inlabels=None, fc='g', alpha=0.2)
+ inlabels=None)
191
outtexts[1].set_color('r')
192
outtexts[-1].set_fontweight('bold')
193
examples/api/skewt.py
@@ -238,11 +238,11 @@ def _set_lim_and_transforms(self):
238
239
# Plot the data using normal plotting functions, in this case using
240
# log scaling in Y, as dicatated by the typical meteorological plot
241
- ax.semilogy(T, p, 'r')
242
- ax.semilogy(Td, p, 'g')
+ ax.semilogy(T, p)
+ ax.semilogy(Td, p)
243
244
# An example of a slanted line at constant X
245
- l = ax.axvline(0, color='b')
+ l = ax.axvline(0)
246
247
# Disables the log-formatting that comes with semilogy
248
ax.yaxis.set_major_formatter(ScalarFormatter())
0 commit comments