Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0bb268

Browse files
committed
Updated the fill test to get the hatching.
Explicitly deprecated axes.color_cycle
1 parent6956367 commitb0bb268

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

‎lib/matplotlib/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
importcontextlib
117117
importdistutils.sysconfig
118118

119+
fromcyclerimportcycler
120+
119121
# cbook must import matplotlib only within function
120122
# definitions, so it is safe to import from it here.
121123
frommatplotlib.cbookimportis_string_like,mplDeprecation
@@ -826,6 +828,8 @@ def matplotlib_fname():
826828
'svg.embed_char_paths': ('svg.fonttype',
827829
lambdax:"path"ifxelse"none",None),
828830
'savefig.extension': ('savefig.format',lambdax:x,None),
831+
'axes.color_cycle': ('axes.prop_cycle',lambdax:cycler('color',x),
832+
lambdax: [c.get('color',None)forcinx),
829833
}
830834

831835
_deprecated_ignore_map= {

‎lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ def set_prop_cycle(self, prop_cycler=None):
156156
clist=rcParams['axes.color_cycle']
157157
prop_cycler=cycler('color',clist)
158158
self.prop_cycler=itertools.cycle(prop_cycler)
159-
#Make a copy
160-
self._prop_keys=list(prop_cycler.keys)
159+
#This should make a copy
160+
self._prop_keys=prop_cycler.keys
161161

162162
def__call__(self,*args,**kwargs):
163163

‎lib/matplotlib/tests/test_cycles.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ def test_linestylecycle_basic():
4444
deftest_fillcycle_basic():
4545
fig=plt.figure()
4646
ax=fig.add_subplot(111)
47-
ax.set_prop_cycle(cycler('color', ['red','green','yellow']))# +
48-
#cycler('hatch', ['xx', 'O', '|-']))
47+
ax.set_prop_cycle(cycler('color', ['r','g','y'])+
48+
cycler('hatch', ['xx','O','|-']))
4949
xs=np.arange(10)
5050
ys=0.25*xs**.5+2
51-
ax.fill(xs,ys,label='red, x')
51+
ax.fill(xs,ys,label='red, x',facecolor='none')
5252
ys=0.45*xs**.5+3
53-
ax.fill(xs,ys,label='green, circle')
53+
ax.fill(xs,ys,label='green, circle',facecolor='none')
5454
ys=0.65*xs**.5+4
55-
ax.fill(xs,ys,label='yellow, cross')
55+
ax.fill(xs,ys,label='yellow, cross',facecolor='none')
5656
ys=0.85*xs**.5+5
57-
ax.fill(xs,ys,label='red2, x2')
57+
ax.fill(xs,ys,label='red2, x2',facecolor='none')
5858
ax.legend(loc='upper left')
5959

6060

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp