pcolormesh edgecolors does not work correctly #901

Merged
merged 1 commit into from May 31, 2012

Conversation

Projects
None yet
3 participants
Contributor

mdboom commented May 29, 2012

At the moment, the following code produces a mesh with black edges:

fig = plt.figure()
ax = fig.add_subplot(1,1,1)
x = np.linspace(-10., 10., 11)
y = np.linspace(-10., 10., 11)
ax.pcolormesh(x, y, np.ones((10, 10)), edgecolors='w')
fig.savefig('mesh.png')

Looking at the matplotlib code, it looks like the draw_quad_mesh renderer method should really take an argument for edgecolors rather than just setting the edges to black by default.

mdboom was assigned May 29, 2012

Owner

mdboom commented May 29, 2012

The attached PR should allow for passing edgecolors to pcolormesh. You can even pass a list of colors if you like.

efiring merged commit efb68e0 into matplotlib:master May 31, 2012

@efiring efiring added a commit to efiring/matplotlib that referenced this pull request Jun 6, 2012

@efiring efiring colorbar: update to work with #901 (41fcab5)
edgecolors='None' now must be included explicitly.  Even if
this change in the default is reverted, it makes sense for
colorbar to be explicit about it.
56b6ba5

@mdboom mdboom added a commit to mdboom/matplotlib that referenced this pull request Jun 7, 2012

@mdboom mdboom Fix bug introduced in #901 and mentioned later in #929. The default b…
…ehavior of pcolormesh should be to draw no edges if no `edgecolors` kwarg is provided.
577689e

@efiring efiring added a commit to efiring/matplotlib that referenced this pull request Jul 9, 2012

@efiring efiring Fix bug in pcolorfast introduced by #901 b6c5625

@pelson pelson commented on the diff Jul 10, 2012

lib/matplotlib/axes.py
@@ -7224,13 +7219,8 @@ def pcolormesh(self, *args, **kwargs):
coords[:, 0] = X
coords[:, 1] = Y
- if shading == 'faceted' or edgecolors != 'None':
@pelson

pelson Jul 10, 2012

Member

Direct "None" comparison excludes the use of the lowercase "none" equivalent. I will open a ticket for this.

@mdboom

mdboom Jul 10, 2012

Owner

Note this is a line that was removed, not introduced by this PR.

@jenshnielsen jenshnielsen added a commit to jenshnielsen/matplotlib that referenced this pull request Aug 31, 2012

@jenshnielsen jenshnielsen Make colorbar draw edge with facecolor around the faces. This was cha…
…nged when #901 and was

merged, to allow different edgecolors, due to the way get_edgecolors behave. This restors the
original behavior of colorbar in both mpl and the axisgrid1 toolkit by setting the edgecolor to 'face'
d631dfd

mdboom deleted the mdboom:quad_mesh_color branch Mar 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment