#12212: Colormap for implicit_plot3d and parametric_plot3d
-------------------------------------+-------------------------------------
Reporter: niles | Owner: jason, was
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.3
Component: graphics | Resolution:
Keywords: colormap, plot | Merged in:
Authors: Joris | Reviewers:
Vankerschaver, Frédéric Chapoton | Work issues:
Report Upstream: N/A | Commit:
Branch: u/chapoton/12212 | 10e1a7af46b4fca28339970c51688e0026e1ba47
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by niles):
Replying to [comment:40 chapoton]:
> Hello,
>
> I have polished the doc a little bit more, and included `texture_map` in
the doc. In my opinion this is getting closer to the `needs_review`
status. It is already quite a big "patch".
Thanks for all the work here -- I've been testing it too and I'm really
impressed with the progress! Here are some things that I think still need
to be addressed:
* I think there need to be some more doctests that verify the coloring of
triangles is working. At the moment, if some bug stopped colors from
being applied to triangles, I think most of the doctests would still pass.
Maybe at least you could add tests in `IndexFaceSet` for `tachyon_repr`,
`obj`, and `x3d_geometry` similar to the one for `json_repr`.
* Was `IndexFaceSet.dual` broken before this patch? Is there another
ticket open for it?
* The argument `texture_list` for `IndexFaceSet.__init__` displaces the
argument `enclosed`, which technically means that the new behavior is not
backwards-compatible. I'm sorry to bring this up, because I think it's a
really annoying detail, but I think Sage policy is that there should be a
deprecation period in case someone somewhere is using `S =
IndexFaceSet(face_list, point_list, False)`. One thing would be to add a
check `if type(texture_list) is bool:..." which issues a deprecation
warning and fixes the arguments. Or, maybe better, put the texture
argument after the enclosure one, and always use it as a keyword.
* Since colormaps don't work with jmol, I think the demonstrations in
parametric_plot3d and elsewhere should specifiy a viewer where they do
work. For example:
{{{
sage: u,v = var('u,v')
sage: col = rainbow(10, 'rgbtuple')
sage: def cf(u,v): return sin(u^2 + v^2)**2
sage: parametric_plot3d((u, u+v, v), (u, -3,3), (v, -3, 3), colordata=(cf,
colormaps.PiYG), viewer='tachyon')
}}}
* Why do this example and some others look so bad? I think the first
examples (the ones users are most likely to see) should be chosen to look
really good. If specifying a large number of plot points and marking
#long or #optional is necessary, then I think that's better than fast but
low-quality examples. (Fast, low-quality examples are good for automatic
testing, in parts of the documentation that new users are not likely to
start with.)
* The syntax for colormaps of plotted functions (e.g. with `plot3d`) and
parametric surfaces should be the same if at all possible. Since `plot3d`
calls `parametric_plot3d`, they should use the same code for colormaps.
Also check `plot3d_adaptive` to see what it's doing.
* In `parametric_plot3d`, wouldn't it be more consistent to use
`color_data` for the argument name, rather than `colordata`? I know
`colormap` is an established argument name (coming from matplot lib, I
think), but I think it's better to use Sage's convention if possible.
* `ImplicitSurface` is derived from `IndexFaceSet`, so it should be
reasonably straightforward to get colormaps for implicit plots working
too. Is there a good way to do it without just duplicating the code from
`ParametricSurface`? There seems to already be some duplicated code
between them. Maybe there needs to be some other kind of `PlotSurface`
class that contains the common code?
--
Ticket URL: <http://trac.sagemath.org/ticket/12212#comment:42>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.