2014-02-18 102 views
0

我正在使用plot3d繪製MATHEMATICA中的3D圖。在Z軸上,我得到的數字爲 ,比如2. * 10^5。如何在2之後擺脫這個小數點? 下面是代碼的一部分,我想我需要在那裏改變一些東西,但我不知道究竟怎麼了(也許某處蜱聲明):在MATHEMATICA中刪除Z軸中數字的小數點嗎?

ticks[min_, max_, n_] := Transpose[Function[z, {z, Function[x, 
     ScientificForm[[email protected]]] /@ z}]@FindDivisions[{min, max}, n]] 

m = 50; 
n = 5; 

po = Plot3D[{x^2 + y^2, -x^2 - y^2}, {x, -m, m}, {y, -m, m}, 
    Boxed -> False, Ticks -> {Automatic, Automatic, ticks[#1, #2, n] &}, 
    ColorFunction -> "LightTemperatureMap", 
    AxesLabel -> {Style[\[Xi], Bold, Black], 
    Style[\[Tau], Bold, Black]}, LabelStyle -> {Black, Bold, 14}, 
    PlotLabel -> Style["(d)", Bold, 24], PlotRange -> All, Mesh -> None] 
+0

已經問在[Mathematica.SE]上回答:http://mathematica.stackexchange.com/q/5369/121 - 請在那裏問你未來的* Mathematica *問題。 –

回答

0
ticks[min_, max_, n_] := Transpose[Function[z, {z, Function[x, 
     ScientificForm[[email protected] /. (0. -> 0), 
     NumberPoint -> If[IntegerQ[x] && 
      Union[[email protected]@x] == {0}, "", "."]]] /@ z}]@ 
    FindDivisions[{min, max}, n]] 

m = 50; 
n = 5; 

po = Plot3D[{x^2 + y^2, -x^2 - y^2}, {x, -m, m}, {y, -m, m}, 
    Boxed -> False, Ticks -> {Automatic, Automatic, ticks[#1, #2, n] &}, 
    ColorFunction -> "LightTemperatureMap", 
    AxesLabel -> {Style[\[Xi], Bold, Black], 
    Style[\[Tau], Bold, Black]}, LabelStyle -> {Black, Bold, 14}, 
    PlotLabel -> Style["(d)", Bold, 24], PlotRange -> All, Mesh -> None] 

enter image description here