2011-10-11 75 views
3

我想看看依赖于参数n的一些函数的实部和虚部。单独(设定值为n),我可以得到非常好的图形,但是将它们放入Manipulate时,它们会变得非常小。把两个绘图放在一个操作中,同时保持绘图可见

下面是我正在使用的确切代码;删除操作和图形显示在一个很好的大小,但它与它们太小,无法辨认。

Manipulate[ 
Plot3D[Im[Sqrt[-1 + (x + I y)^2 n]], {x, -2, 2}, {y, -1, 1}, 
    AxesLabel -> Automatic] 
    Plot3D[Re[Sqrt[-1 + (x + I y)^2 n]], {x, -2, 2}, {y, -2, 2}, 
    AxesLabel -> Automatic] 
, {n, 1, 10, 1}] 

为什么它这样做,我该如何解决它?

+0

在这段代码中,你正在成倍两个地块。从来不是一个好主意。可以列出它们,并添加{}和一个逗号。 –

+0

@ SjoerdC.deVries,对我来说,在我的代码中甚至有这样的错误是很常见的。即使将它们封装在“{}”中,我仍然会忘记用逗号分隔这些术语。追踪可能是令人沮丧的错误。 – rcollyer

回答

6
Manipulate[ 
Row[{ 
    Plot3D[Im[Sqrt[-1 + (x + I y)^2 n]], {x, -2, 2}, {y, -1, 1}, 
      AxesLabel -> Automatic, ImageSize -> 300] , 
    Plot3D[Re[Sqrt[-1 + (x + I y)^2 n]], {x, -2, 2}, {y, -2, 2}, 
      AxesLabel -> Automatic, ImageSize -> 300]}], 
{n, 1, 10, 1}] 

enter image description here

编辑

请记住,你还可以这样做:

a = Sequence @@{{x, -2, 2}, {y, -1, 1}, AxesLabel-> Automatic, ImageSize-> 200}; 
Manipulate[ 
Row[{ 
    Plot3D[Im[Sqrt[-1 + (x + I y)^2 n]], [email protected]], 
    Plot3D[Re[Sqrt[-1 + (x + I y)^2 n]], [email protected]]}], 
{n, 1, 10, 1}, 
PreserveImageOptions -> False] 
+1

“ImageSize - > 300”就足够了。谢谢! – VolatileStorm

+0

@belisarius'Row'需要'List'作为第一个参数。它解释了为什么它在你的屏幕截图上仍未评估。 –

+0

@Alexey谢谢。我没有注意到(我正在玩几个替代品,并最终选择了这一个)。编辑 –

相关问题