ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 16 May 2019 03:12:51 +0200Discontinuous surface color by z-levelhttps://ask.sagemath.org/question/46541/discontinuous-surface-color-by-z-level/Hi there,
I want to plot a surface $z=f(x,y)$ together with the level curves (side by side). I know how to doi it when $f$ is continuous, or even bounded, but I run in trouble for uglier functions. Here are two examples (in CoCalC : a few things need to be adapted to use Jupyter) : the first works
var('x,y,s,t')
h(x,y)= x*y^2/(x^2+y^4)
cm = colormaps.Blues
def c(x,y):
return 0.6+x*y^2/(x^2+y^4+0.005)# Colorier ceci pose des problèmes, à cause de la singularité.
S=plot3d(h,(x,-1,1),(y,-1,1),color = (c,cm), opacity=1, mesh=1)
show(S)
C=contour_plot(h, (x,-1, 1), (y,-1, 1),cmap='Blues',linestyles='solid', colorbar=True)
show(C,figsize=4)
While the second, below, does not work as I would like to
h(x,y)= y/(x^2+y^2)
cm = colormaps.Spectral
def c(x,y):
return float(y/(x^2 + y^2+0.005))# Colorier ceci pose des problèmes, à cause de la singularité.
S=plot3d(h,(x,-1,1),(y,-1,1),color = (c,cm), opacity=1, mesh=1)
show(S, frame_aspect_ratio=[20,20,1])
C=contour_plot(h,(x,-1.5,1.5),(y,-1.5,1.5), cmap = "Spectral",
contours = [-2,-1, -0.5,-0.25,0,0.25,0.5,1,2], colorbar = True,
axes = True,
labels = True, label_colors='black',
label_inline=True, label_fontsize=8,
gridlines = True, axes_labels=['$x$','$y$'])
show(C,figsize=8)
I tried a few things, among other, what can be found https://ask.sagemath.org/question/7581/use-a-colormap-for-implicit_plot3d/[here (old post)](https://ask.sagemath.org/question/7581/use-a-colormap-for-implicit_plot3d/), but the discontinuity seems to cause some problems.
Suggestions?JCThu, 16 May 2019 03:12:51 +0200https://ask.sagemath.org/question/46541/different color on backside of surfacehttps://ask.sagemath.org/question/10290/different-color-on-backside-of-surface/Hey,
I want to animate a 3D plot. Therefore I generate tachyon rendered implicit plots which I then send to ffmpeg. This works quite well. The only disadvantege, is that it's during the video hard to distinguish which side of the surface one sees. Therefore I want to change the color of the backside or at least increase the shadow.
I already tried some stuff with the tachyon raytracer building a scene. But this does not work for implicit plots. The solution given [here](http://ask.sagemath.org/question/20/the-tachyon-object-used-for-rendering-plots) seems not to be very usefull in this context.
Is there perhaps a simply trick, which does the job?
ThorstenWed, 26 Jun 2013 17:38:03 +0200https://ask.sagemath.org/question/10290/