Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcolormesh bug: edgecolor ignored #1302

Closed
bblay opened this issue Sep 24, 2012 · 11 comments · Fixed by #18480
Closed

pcolormesh bug: edgecolor ignored #1302

bblay opened this issue Sep 24, 2012 · 11 comments · Fixed by #18480
Labels
Good first issue Open a pull request against these issues if there are no active ones! status: confirmed bug

Comments

@bblay
Copy link
Contributor

bblay commented Sep 24, 2012

I believe the following code should produce grey edges but they have colour.

import numpy as np
import matplotlib.pyplot as plt

plt.pcolormesh(np.arange(12).reshape(4, 3), edgecolor='#888888', facecolor='none')
plt.show()
@dmcdougall
Copy link
Member

@bblay Thanks for pointing this out.

pcolormesh(np.arange(12).reshape(4, 3), edgecolors='b', facecolor='g') produces faces that are not all green, but all the edges are blue.

@WeatherGod
Copy link
Member

Note the difference: "edgecolor" and "edgecolors"

@WeatherGod
Copy link
Member

In other words, the bug probably is that we aren't triggering an error for passing in "edgecolor", since the documentation states that it should be "edgecolors".

@WeatherGod
Copy link
Member

Also, I would imagine that "facecolor" makes no sense for the pcolor family of functions, but that is just my own opinion. "facecolor" is not mentioned in the documentation for those functions, AFAICT.

@pelson
Copy link
Member

pelson commented Sep 25, 2012

Confirmed. The following code fails to produce a quadmesh with red edges:

c = plt.pcolormesh(np.arange(12).reshape(4, 3), edgecolors='red', facecolors='none')

(they are colored by the data).

Workaround:

c._is_stroked = False

There are some fundamental flaws with the way this has been implemented, and fixing them will break existing code.
It doesn't appear that this has worked since at least 1.0 (unable to test before then).

I suggest that this goes into the known bugs milestone for 1.2, and we address it in 1.3.

@mdboom & @efiring : I think you two have most exposure to the QuadMesh collection; do you agree with this, or would you like me to fix this and slip it in to 1.2? (I could have a PR ready in <24 hrs)

Full disclosure: @bblay and I are colleagues.

@tacaswell
Copy link
Member

This is still an issue on master. Tagged an 1.4, but this is a candidate to slip to 1.5 as it never seems to have worked.

@tacaswell tacaswell modified the milestones: v1.4.x, v1.4.0 Apr 27, 2014
@tacaswell
Copy link
Member

punting (again)

@efiring
Copy link
Member

efiring commented Apr 27, 2014

@pelson do you remember what your proposed fix was, and what it would break? And what were the "fundamental flaws"? I suspect we should have taken you up on your offer to generate a PR.

@pelson
Copy link
Member

pelson commented Apr 28, 2014

Unfortunately I don't. Logically it seems that an edgecolor of 'none', 'face', a specific color or an array are all supportable behaviour which should work. It might be worth investigating again and putting forward a proposed solution.

@tacaswell tacaswell modified the milestones: v1.4.x, 1.5.0 Feb 7, 2015
@tacaswell tacaswell modified the milestones: proposed next point release, next point release Jul 17, 2015
@doylejg
Copy link

doylejg commented Nov 27, 2015

Just confirming this bug in 1.4.3, has this been fixed in 1.5.0?

@efiring
Copy link
Member

efiring commented Nov 27, 2015

Both pcolormesh and pcolor use colormapping based on the input array for the edges when the facecolor='none', regardless of the setting of edgecolors. I note that 'facecolor' is not in the docstrings; it is simply being passed on the Collection. It sounds like the desired behavior would be for the facecolor='none' case to be trapped and used to defeat the colormapping of edges when edgecolors is also specified.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@dstansby dstansby added the Good first issue Open a pull request against these issues if there are no active ones! label Apr 12, 2018
@story645 story645 removed this from the future releases milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Open a pull request against these issues if there are no active ones! status: confirmed bug
Projects
None yet
9 participants