Ask Your Question

qed's profile - activity

2015-07-17 05:03:01 +0100 received badge  Notable Question (source)
2015-07-17 05:03:01 +0100 received badge  Popular Question (source)
2013-11-19 11:37:20 +0100 marked best answer Combine two 3d plots

You have a very small typo. == is for an equation, but = is for keywords. Try this.

var('x,y,z')
implicit_plot3d(x^2+y^2+z^2==4, (x, -3, 3), (y, -3,3), (z, -3,3)) + implicit_plot3d(x^2+y^2+1.75^2==4, (x, -3, 3), (y, -3, 3), (z, -3, 3))
2013-11-19 11:37:20 +0100 received badge  Scholar (source)
2013-11-19 11:37:19 +0100 received badge  Supporter (source)
2013-11-19 08:40:42 +0100 asked a question Combine two 3d plots

It's possible to combine two 2d plots in one:

sum([plot(x^n,(x,0,1),color=rainbow(5)[n], figsize=3) for n in range(5)])

How can this be done for 3d plots? For example, I tried this:

implicit_plot3d(x^2+y^2+z^2==4, (x, -3, 3), (y, -3,3), (z, -3,3)) + implicit_plot3d(x^2+y^2+1.75^2=4, (x, -3, 3), (y, -3, 3), (z, -3, 3))

But it generates this error:

File "<ipython-input-8-6cd08d1c769f>", line 1
SyntaxError: keyword can't be an expression