Recently I made a patch to improve the handling of colormap, which has
been merged in 3.3 (http://trac.sagemath.org/sage_trac/ticket/4884)

There was some discussion on the ticket (read the comments) which may
have confused everybody.

I proposed adding a function to the global namespace called
cmap_help() which would print an explanation of how to input colormaps
for the various functions that require them.  I made this choice since
the description is rather long and the list of valid colormap names
changes with each matplotlib release.  Having a function I could make
the string dynamic and automatically put in the available names for
the current Sage.

>From the comments, I thought William opposed the idea of adding a new
function to the global namespace for that purpose so I made another
patch that gave information on how to fetch the list of names yourself
to each function.  It was this patch that was merged.

>From all that, kcrisman asked through a trac ticket:
>
> 1. So should there be cmap_help or not? abergeron's last
> statement in #4884 implies yes. If so...
>
> 2. For every function (e.g. matrix_plot) where cmap is an option,
> that function's docstring should have as a doctest a full call of
> cmap_help (or whatever with its output. Also in the cmap_help
> doctest should have the whole output of cmap_help show up,
> not have ... where the actual colormaps are outputted.
>

I personally don't feel strongly for cmap_help(), it just seems like
the most appropriate solution for the problem.

I do feel strongly though that testing the list of colormap names in
each function that uses colormaps is a bad idea since it will make
every matplotlib painful.

There could be a doctest somewhere that checks the list has not
changed but I don't see the point with that since it just as painful
as testing everywhere, but with the added risk that the lists that are
not tested will get out of date.

Finally since it is possible to automatically obtain the current list
of names, the ideal solution would be something that does just that
and puts the list either in the documentation of each function or in a
central place.

Arnaud

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to