Skip to content

Commit 20c7447

Browse files
committed
changed pcolor default to shading='flat'; related cleanups
svn path=/trunk/matplotlib/; revision=3628
1 parent a3b56d3 commit 20c7447

File tree

8 files changed

+130
-102
lines changed

8 files changed

+130
-102
lines changed

API_CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Changed pcolor default to shading='flat'; but as noted now in the
2+
docstring, it is preferable to simply use the edgecolor kwarg.
3+
14
The mathtext font commands (\cal, \rm, \it, \tt) now behave as TeX
25
does: they are in effect until the next font change command or the
36
end of the grouping. Therefore uses of $\cal{R}$ should be

CHANGELOG

Lines changed: 63 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,70 @@
1+
2007-07-29 Changed default pcolor shading to flat; added aliases
2+
to make collection kwargs agree with setter names, so
3+
updating works; related minor cleanups.
4+
15
2007-07-26 Major rewrite of mathtext.py, using the TeX box layout model.
26

3-
There is one (known) backward incompatible change. The
4-
font commands (\cal, \rm, \it, \tt) now behave as TeX does:
5-
they are in effect until the next font change command or
6-
the end of the grouping. Therefore uses of $\cal{R}$
7-
should be changed to ${\cal R}$. Alternatively, you may
8-
use the new LaTeX-style font commands (\mathcal, \mathrm,
9-
\mathit, \mathtt) which do affect the following group,
10-
eg. $\mathcal{R}$.
7+
There is one (known) backward incompatible change. The
8+
font commands (\cal, \rm, \it, \tt) now behave as TeX does:
9+
they are in effect until the next font change command or
10+
the end of the grouping. Therefore uses of $\cal{R}$
11+
should be changed to ${\cal R}$. Alternatively, you may
12+
use the new LaTeX-style font commands (\mathcal, \mathrm,
13+
\mathit, \mathtt) which do affect the following group,
14+
eg. $\mathcal{R}$.
1115

12-
Other new features include:
16+
Other new features include:
1317

14-
- Math may be interspersed with non-math text. Any text
18+
- Math may be interspersed with non-math text. Any text
1519
with an even number of $'s (non-escaped) will be sent to
16-
the mathtext parser for layout.
20+
the mathtext parser for layout.
1721

18-
- Sub/superscripts are less likely to accidentally overlap.
22+
- Sub/superscripts are less likely to accidentally overlap.
1923

20-
- Support for sub/superscripts in either order, eg. $x^i_j$
24+
- Support for sub/superscripts in either order, eg. $x^i_j$
2125
and $x_j^i$ are equivalent.
2226

23-
- Double sub/superscripts (eg. $x_i_j$) are considered
27+
- Double sub/superscripts (eg. $x_i_j$) are considered
2428
ambiguous and raise an exception. Use braces to disambiguate.
2529

26-
- $\frac{x}{y}$ can be used for displaying fractions.
30+
- $\frac{x}{y}$ can be used for displaying fractions.
2731

28-
- $\sqrt[3]{x}$ can be used to display the radical symbol
32+
- $\sqrt[3]{x}$ can be used to display the radical symbol
2933
with a root number and body.
3034

31-
- $\left(\frac{x}{y}\right)$ may be used to create
35+
- $\left(\frac{x}{y}\right)$ may be used to create
3236
parentheses and other delimiters that automatically
3337
resize to the height of their contents.
3438

35-
- Spacing around operators etc. is now generally more like
39+
- Spacing around operators etc. is now generally more like
3640
TeX.
3741

38-
- Added support (and fonts) for boldface (\bf) and
42+
- Added support (and fonts) for boldface (\bf) and
3943
sans-serif (\sf) symbols.
4044

41-
- Log-like function name shortcuts are supported. For
45+
- Log-like function name shortcuts are supported. For
4246
example, $\sin(x)$ may be used instead of ${\rm sin}(x)$
4347

44-
- Limited use of kerning for the easy case (same font)
48+
- Limited use of kerning for the easy case (same font)
4549

46-
Behind the scenes, the pyparsing.py module used for doing
47-
the math parsing was updated to the latest stable version
48-
(1.4.6). A lot of duplicate code was refactored out of the
49-
Font classes.
50+
Behind the scenes, the pyparsing.py module used for doing
51+
the math parsing was updated to the latest stable version
52+
(1.4.6). A lot of duplicate code was refactored out of the
53+
Font classes.
5054

51-
- MGD
55+
- MGD
5256

5357
2007-07-19 completed numpification of most trivial cases - NN
5458

5559
2007-07-19 converted non-numpy relicts troughout the code - NN
5660

5761
2007-07-19 replaced the Python code in numerix/ by a minimal wrapper around
5862
numpy that explicitly mentions all symbols that need to be
59-
addressed for further numpification - NN
63+
addressed for further numpification - NN
6064

61-
2007-07-18 make usetex respect changes to rcParams. texmanager used to
62-
only configure itself when it was created, now it
63-
reconfigures when rcParams are changed. Thank you Alexander
65+
2007-07-18 make usetex respect changes to rcParams. texmanager used to
66+
only configure itself when it was created, now it
67+
reconfigures when rcParams are changed. Thank you Alexander
6468
Schmolck for contributing a patch - DSD
6569

6670
2007-07-17 added validation to setting and changing rcParams - DSD
@@ -71,7 +75,7 @@
7175
2007-07-16 clean up some code in ticker.ScalarFormatter, use unicode to
7276
render multiplication sign in offset ticklabel - DSD
7377

74-
2007-07-16 fixed a formatting bug in ticker.ScalarFormatter's scientific
78+
2007-07-16 fixed a formatting bug in ticker.ScalarFormatter's scientific
7579
notation (10^0 was being rendered as 10 in some cases) - DSD
7680

7781
2007-07-13 Add MPL_isfinite64() and MPL_isinf64() for testing
@@ -83,7 +87,7 @@
8387

8488
2007-07-13 Removed the rest of the numerix extension code detritus,
8589
numpified axes.py, and cleaned up the imports in axes.py
86-
- JDH
90+
- JDH
8791

8892
2007-07-13 Added legend.loc as configurable option that could in
8993
future default to 'best'. - NN
@@ -552,35 +556,35 @@
552556

553557
2006-10-10 deactivated rcfile-configurability of markerfacecolor
554558
and markeredgecolor. Both are now hardcoded to the special value
555-
'auto' to follow the line color. Configurability at run-time
556-
(using function arguments) remains functional. - NN
559+
'auto' to follow the line color. Configurability at run-time
560+
(using function arguments) remains functional. - NN
557561

558562
2006-10-07 introduced dummy argument magnification=1.0 to
559563
FigImage.make_image to satisfy unit test figimage_demo.py
560564
The argument is not yet handled correctly, which should only
561-
show up when using non-standard DPI settings in PS backend,
562-
introduced by patch #1562394. - NN
565+
show up when using non-standard DPI settings in PS backend,
566+
introduced by patch #1562394. - NN
563567

564568
2006-10-06 add backend-agnostic example: simple3d.py - NN
565569

566570
2006-09-29 fix line-breaking for SVG-inline images (purely cosmetic) - NN
567571

568572
2006-09-29 reworked set_linestyle and set_marker
569-
markeredgecolor and markerfacecolor now default to
570-
a special value "auto" that keeps the color in sync with
571-
the line color
572-
further, the intelligence of axes.plot is cleaned up,
573-
improved and simplified. Complete compatibility cannot be
574-
guaranteed, but the new behavior should be much more predictable
575-
(see patch #1104615 for details) - NN
573+
markeredgecolor and markerfacecolor now default to
574+
a special value "auto" that keeps the color in sync with
575+
the line color
576+
further, the intelligence of axes.plot is cleaned up,
577+
improved and simplified. Complete compatibility cannot be
578+
guaranteed, but the new behavior should be much more predictable
579+
(see patch #1104615 for details) - NN
576580

577581
2006-09-29 changed implementation of clip-path in SVG to work around a
578582
limitation in inkscape - NN
579583

580584
2006-09-29 added two options to matplotlibrc:
581-
svg.image_inline
582-
svg.image_noscale
583-
see patch #1533010 for details - NN
585+
svg.image_inline
586+
svg.image_noscale
587+
see patch #1533010 for details - NN
584588

585589
2006-09-29 axes.py: cleaned up kwargs checking - NN
586590

@@ -611,8 +615,8 @@
611615
2006-09-05 Released 0.87.5 at revision 2761
612616

613617
2006-09-04 Added nxutils for some numeric add-on extension code --
614-
specifically a better/more efficient inside polygon tester (see
615-
unit/inside_poly_*.py) - JDH
618+
specifically a better/more efficient inside polygon tester (see
619+
unit/inside_poly_*.py) - JDH
616620

617621
2006-09-04 Made bitstream fonts the rc default - JDH
618622

@@ -957,7 +961,7 @@
957961
2006-03-20 Added contour.negative_linestyle rcParam - ADS
958962

959963
2006-03-20 Added _isnan extension module to test for nan with Numeric
960-
- ADS
964+
- ADS
961965

962966
2006-03-17 Added Paul and Alex's support for faceting with quadmesh
963967
in sf patch 1411223 - JDH
@@ -1304,7 +1308,7 @@
13041308

13051309

13061310
2005-11-09 added axisbelow attr for Axes to determine whether ticks and such
1307-
are above or below the actors
1311+
are above or below the actors
13081312

13091313
2005-11-08 Added Nicolas' irregularly spaced image patch
13101314

@@ -1461,7 +1465,7 @@
14611465

14621466
2005-07-24 backend_gtk.py: modify print_figure() use own pixmap, fixing
14631467
problems where print_figure() overwrites the display pixmap.
1464-
return False from all button/key etc events - to allow the event
1468+
return False from all button/key etc events - to allow the event
14651469
to propagate further - SC
14661470

14671471
2005-07-23 backend_gtk.py: change expose_event from using set_back_pixmap();
@@ -1483,7 +1487,7 @@
14831487
2005-07-14 Fixed a Windows related bug (#1238412) in texmanager - DSD
14841488

14851489
2005-07-11 Fixed color kwarg bug, setting color=1 or 0 caused an
1486-
exception - DSD
1490+
exception - DSD
14871491

14881492
2005-07-07 Added Eric's MA set_xdata Line2D fix - JDH
14891493

@@ -1585,10 +1589,10 @@
15851589
2005-06-13 Exposed cap and join style for lines with new rc params and
15861590
line properties
15871591

1588-
lines.dash_joinstyle : miter # miter|round|bevel
1589-
lines.dash_capstyle : butt # butt|round|projecting
1590-
lines.solid_joinstyle : miter # miter|round|bevel
1591-
lines.solid_capstyle : projecting # butt|round|projecting
1592+
lines.dash_joinstyle : miter # miter|round|bevel
1593+
lines.dash_capstyle : butt # butt|round|projecting
1594+
lines.solid_joinstyle : miter # miter|round|bevel
1595+
lines.solid_capstyle : projecting # butt|round|projecting
15921596

15931597

15941598
2005-06-13 Added kwargs to Axes init
@@ -1702,9 +1706,9 @@
17021706
for the interp kwarg are
17031707

17041708
'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36',
1705-
'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
1706-
'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
1707-
'lanczos', 'blackman'
1709+
'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
1710+
'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
1711+
'lanczos', 'blackman'
17081712

17091713
See help(imshow) for details, particularly the
17101714
interpolation, filternorm and filterrad kwargs

examples/pcolor_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def func3(x,y):
1919
X,Y = meshgrid(x, y)
2020

2121
Z = func3(X, Y)
22-
pcolor(X, Y, Z, shading='flat')
22+
pcolor(X, Y, Z)
2323
colorbar()
2424
axis([-3,3,-3,3])
2525
savefig('pcolor_demo')

examples/pcolor_log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
Z1 = bivariate_normal(X, Y, 0.1, 0.2, 1.0, 1.0) + 0.1*bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
1616

1717
subplot(2,1,1)
18-
pcolor(X, Y, Z1, shading='flat', norm=LogNorm(vmin=Z1.min(), vmax=Z1.max()))
18+
pcolor(X, Y, Z1, norm=LogNorm(vmin=Z1.min(), vmax=Z1.max()))
1919
colorbar()
2020

2121
subplot(2,1,2)
22-
pcolor(X, Y, Z1, shading='flat')
22+
pcolor(X, Y, Z1)
2323
colorbar()
2424

2525

examples/pcolor_small.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
from pylab import *
44

5-
#Z = arange(60)
6-
#Z.shape = 6,10
7-
#Z.shape = 10,6
8-
#print Z
9-
Z = rand(10,6)
5+
Z = rand(6,10)
106

11-
#c = pcolor(Z, shading='flat') # default 'faceted'
7+
subplot(2,1,1)
128
c = pcolor(Z)
13-
c.set_linewidth(4)
9+
title('default: no edges')
10+
11+
subplot(2,1,2)
12+
c = pcolor(Z, edgecolors='k', linewidths=4)
13+
title('thick edges')
1414

15-
#savefig('pcolor_small')
1615
show()

lib/matplotlib/artist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ def remove(self):
5555
Remove the artist from the figure if possible. The effect will not
5656
be visible until the figure is redrawn, e.g., with ax.draw_idle().
5757
Call ax.relim() to update the axes limits if desired.
58-
58+
5959
Note: relim() will not see collections even if the collection
6060
was added to axes with autolim=True.
6161
6262
Note: there is no support for removing the artist's legend entry.
6363
'''
6464

6565
# There is no method to set the callback. Instead the parent should set
66-
# the _remove_method attribute directly. This would be a protected
66+
# the _remove_method attribute directly. This would be a protected
6767
# attribute if Python supported that sort of thing. The callback
6868
# has one parameter, which is the child to be removed.
69-
if self._remove_method != None:
69+
if self._remove_method != None:
7070
self._remove_method(self)
7171
else:
7272
raise NotImplementedError('cannot remove artist')

0 commit comments

Comments
 (0)