ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 01 Apr 2015 14:03:57 -0500How to color a 3d plot by z-level?http://ask.sagemath.org/question/8964/how-to-color-a-3d-plot-by-z-level/I'd like to color a 3d plot based on z-level. I think this is easy to do in Maple or Mathematica, but I've been searching the web for help on doing this in Sage and can't find anything to help with plot3d or implicit_plot3d.
Here's the implicit_plot3d I'm using.
var('x,y,z')
implicit_plot3d(x^2-y^2*z == 0,(x,-4,4),(y,-4,4),(z,-4,4)).show(mesh=True)
Also, are there color maps in Sage that produce plots with colors and lighting similar to the default in Mathematica?
calc314Wed, 09 May 2012 16:27:40 -0500http://ask.sagemath.org/question/8964/use a colormap for implicit_plot3dhttp://ask.sagemath.org/question/7581/use-a-colormap-for-implicit_plot3d/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
`implicit_plot3d`, and color it according to a particular color map. I
see that `implicit_plot3d` passes its arguments to
`sage.plot.plot3d.implicit_plot3d.ImplicitSurface`
but I can't figure out more than this . . . when I try
`sage: sage.plot.plot3d.implicit_plot3d.ImplicitSurface??`
I get
`Error getting source: could not find class definition`
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 12212nilesThu, 19 Aug 2010 00:26:08 -0500http://ask.sagemath.org/question/7581/Coloring surfaces in plot3dhttp://ask.sagemath.org/question/9068/coloring-surfaces-in-plot3d/I'm really new with sage, and what I would like is to color a graph from plot3d according to some function (specifically, I would want the hue to vary with the magnitude of the gradient). Is there some way of doing this easily?hihoWed, 12 Sep 2012 11:16:12 -0500http://ask.sagemath.org/question/9068/How to use colormaps in matplotlib on Sagemathhttp://ask.sagemath.org/question/26421/how-to-use-colormaps-in-matplotlib-on-sagemath/I want to use the colormap "autumn" that is in matplotlib ( http://matplotlib.org/examples/color/colormaps_reference.html ) on a list of points I want to plot in Sagemath. How I can import this and use it?MonsieurGaloisWed, 01 Apr 2015 14:03:57 -0500http://ask.sagemath.org/question/26421/How to make a custom divergent colormap?http://ask.sagemath.org/question/24180/how-to-make-a-custom-divergent-colormap/How can I make a custom diverging colormap in Sage?
What I want is the same than the reverse `seismic` diverging colormap ([Diverging Colormaps](http://matplotlib.org/examples/color/colormaps_reference.html)) but the blue value should be less intense (e. g. conflower blue [Hex color code: #6495ED]).
In the sage source code I found the following link [Diverging Colormaps](http://www.sandia.gov/~kmorel/documents/ColorMaps/), which explains the divergent colormaps and has a python class in the attachments. But still I have no clue to make such a diverging colormap.
I have also tried to make it with a LinearSegementedColormap:
from pylab import *
startcolor = '#FF0000'
midcolor = '#FFFFFF'
endcolor = '#0030CC'
own_cmap1 = matplotlib.colors.LinearSegmentedColormap.from_list( 'own2', [startcolor, midcolor, endcolor] )
matrix_plot( matrix( [ [1,3,5,1], [2,4,5,6], [1,-3,5,7] ] ), cmap = own_cmap1, colorbar = True )
but the result is absolutely not what I want, because it goes too fast from red into pink.
balduinThu, 18 Sep 2014 07:49:34 -0500http://ask.sagemath.org/question/24180/Custom color map for matrix plot?http://ask.sagemath.org/question/24051/custom-color-map-for-matrix-plot/I need colormap which has for a fixed value x the color white and all values above x are colorized from white do blue and all values below x are colorized from white to red.
The first question is, is this possible?
And my second question how can I do that?balduinMon, 08 Sep 2014 10:27:10 -0500http://ask.sagemath.org/question/24051/Controling the color of a parametric surface.http://ask.sagemath.org/question/11354/controling-the-color-of-a-parametric-surface/I would like to represent a complex valued function on a parametric surface. I know that the complex_plot function can represent a complex function using colors. Is there a way of using it to color parametric surfaces? In other words, can I define the colors of the points of a parametric surface in terms of the two parameters in a natural and easy way?
RaulTue, 29 Apr 2014 15:48:30 -0500http://ask.sagemath.org/question/11354/Colorbar for density plotshttp://ask.sagemath.org/question/9460/colorbar-for-density-plots/Hi!
I would like to know if there is a way to get a colorbar for a density plot. For contour plots this works fine with the colorbar=True option, but for density plots there doesn't seem to be such an option. Can anyone help?
Greetings,
MelvinMelvinSmithTue, 23 Oct 2012 13:57:25 -0500http://ask.sagemath.org/question/9460/Specific cmaphttp://ask.sagemath.org/question/7825/specific-cmap/Hello,
How would I create a specific cmap, which would have a separate color value for each matrix value? For example, could I make a cmap that specifies 0:'red', 1:'green', 2:'yellow', etc? The linear interpolation cmaps don't work as I want them to because they normalize to the given range of the matrix.
Thank you.Eviatar BachSun, 19 Dec 2010 17:18:36 -0600http://ask.sagemath.org/question/7825/