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

Already on GitHub? Sign in to your account

mplot3d: Interface is inconsistent between contour and surface_plot #690

Closed
nwin opened this Issue Jan 30, 2012 · 4 comments

Comments

Projects
None yet
3 participants
Contributor

nwin commented Jan 30, 2012

surface_plot takes a string for the cmap param (e.g. cmap="jet"), contour needs a ColorMap instance(e.g. cmap=get_cmap("jet")).

I have not tested if this is inconsistent in other cases too.

Member

WeatherGod commented Jan 30, 2012

Inconsistencies are bad, but I am not sure if this is a mistake on mplot3d's part or mpl. Would it be desirable that both functions take both forms? This would maintain compatibility and increase flexibility.

Contributor

nwin commented Feb 12, 2012

Yes, as the normal imshow also takes a string argument and for simplicity I recommend that contour also should take a string argument.

@ghost ghost assigned WeatherGod Feb 21, 2012

Collaborator

jdh2358 commented Feb 26, 2012

In general, we should be able to handle either strings or instances everywhere. We should centralize a to_cmap(arg) function which takes either and returns an instance, and the port this to all of the methods that take a cmap.

Member

WeatherGod commented Sep 20, 2012

This problem was fixed at some point and works fine for v1.2.0. The issue was with matplotlib's ContourSet, so now matplotlib's contour() and contourf() are also accepting both string and Colormap objects. Closing.

@WeatherGod WeatherGod closed this Sep 20, 2012

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