2011-12-05 27 views
2

我正在做一個非常基本的操作 - 在Mathematica中繪製點。下面的代碼:爲什麼點在Mathematica中使用圖形功能時消失

Graphics[ 
{ 
    Point[{0, 0}], Point[{1, 2}] 
    } 
] 

我給出我想要的結果:

enter image description here

但是當我指定的「PlotRange」,然後我得到了一個空白的畫布。爲什麼這兩個點消失了?

Graphics[ 
{ 
    Point[{0, 0}], Point[{1, 2}] 
    }, 
PlotRange -> {{0, 0}, {4, 4}} 
] 

截圖:

enter image description here

如果您不能重現我所遇到的問題,也請讓我知道。謝謝。

回答

8

選項PlotRange使用錯誤。您必須按照{{xmin, xmax}, {ymin, ymax}}的順序給出矩形繪圖區域的角點。

在你的情況

PlotRange -> {{0, 4}, {0, 4}} 
+0

謝謝!我應該更加小心。 – Ning

+4

正如您所見,{0,0}點被削減了一半。在實際程序中調整PlotRange之前,可能應該檢查PlotRangePadding選項。 – halirutan

相關問題