![](/img/trans.png)
[英]How to make a 3d surfaces in Java using TeeChart or JMathTools libraries?
[英]Draw a cube using GridPlot in JMathTools
我想使用jMathPlot繪制一個立方體。 多維數據集的點是:
(0,0,1),(1,0,1),(1,1,1),(0,1,1),(0,0,2),(1,0,2),(1 ,1,2),(0,1,2)
我有這些變量:
double[] x = {0,1,0,1};
double[] y = {0,1,0,1};
double[][] z1 = {{1,1,2,2},
{2,2,1,1},
{1,1,2,2},
{1,1,2,2}};
Plot3DPanel plot = new Plot3DPanel("SOUTH");
plot.addGridPlot("cube", Color.red ,x, y, z1);
它不起作用,老實說,我仍然不明白為什么z
必須是2D數組?
任何幫助,將不勝感激。
在研究了JMathPlot的源代碼之后,我認為Z是2D數組,因為Z是由於某些函數f(x,y)給出的。 有關如何為z參數構造double [] []的信息,請參見GridPlotsExample 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.