| Here's a question I asked a while ago on sage-support, but never got answered, so I'll try it again here: I've been trying to figure out how to plot a surface using
but I can't figure out more than this . . . when I try
I get
and then a few more unhelpful details. It seems like the two possible viewers are jMol and Tachyon, but I can't tell whether either of these support color maps. Any ideas where else I should be looking? Update: This is now Trac ticket 12212 |
| I have once managed to get plot3d use a colormap, see here: lists you the colormaps, you can also create your own. Note, the cmsel list in the following snippet defines the actual colors.
OMFG this is *awesome*. I had no idea this was possible in Sage.
William Stein (Aug 19 '10) |
| I don't know how to comment on another answer, so I'll just post my comment here. You don't have to import matplotlib colormaps, since they are already imported in the sage colormaps object: You can see the available colormaps by doing
You can't comment until you get enough karma.
William Stein (Aug 19 '10)
How hard would it be to implement colorbars for 3D plots?
Mitesh Patel (Aug 22 '10) |
| Thanks for the followup, Niles. This is a really annoying part of some things that are defined in It turns out that
And if you look at THAT you will see that that just goes through a whole slew of possible things the input could be to This still doesn't answer how to GET the colormap, but hopefully tracks down some of why it isn't working.
And `plot3d` seems to also eventually end up at `IndexFaceSet` via `ParametricSurface` anyway, so this doesn't resolve the mystery at all, perhaps.
kcrisman (Aug 21 '10)
But I did finally get the error message, and indeed the problem is in `parse_color`, where there isn't an `else` for `info` something other than a string or `Color`. But the fix would have to be in `Texture` or something. Why *does* it work with `plot3d`?
kcrisman (Aug 21 '10)
Thanks for the help . . . I'll keep digging :)
niles (Aug 21 '10) |
| Apologies for the delay; I assumed the answers from schilly and jason-grout would work (sorry!) but I got around to testing it today and it doesn't work for so the following is fine: but this is not: Niles, did you ever get this to work? I need exactly the same functionality, but for parametric_plot3d, maybe you can open a ticket for this? jvkersch (Dec 20 '11)No, I never did get it working. Instead I redesigned my project so that I didn't need it . . . the ticket is http://trac.sagemath.org/sage_trac/ticket/12212 niles (Dec 21 '11)Great, thanks! I was sort of hoping that you had implemented this for your Hopf fibration video :) jvkersch (Dec 21 '11) |
Asked: Aug 19 '10
Seen: 408 times
Last updated: Dec 21 '11
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.