nplot用法(線 柱 標籤 移動窗體)

2021-04-17 10:40:35 字數 2516 閱讀 2779

myplot.clear();

//加入網格

grid mygrid = new grid();

myplot.add(mygrid);

myplot.title = "測試";

lineplot lp = new lineplot();

double a = new double ;

string b = new string ;

double ab = new double ;

arraylist dates = new arraylist();

dates.add(convert.todatetime("2007-01-01"));

dates.add(convert.todatetime("2008-01-02 "));

dates.add(convert.todatetime("2008-01-03 "));

dates.add(convert.todatetime("2008-01-04 "));

dates.add(convert.todatetime("2008-01-05 "));

dates.add(convert.todatetime("2008-01-06 "));

dates.add(convert.todatetime("2008-01-07 "));

dates.add(convert.todatetime("2008-01-08 "));

dates.add(convert.todatetime("2008-01-09 "));

dates.add(convert.todatetime("2008-01-10 "));

dates.add(convert.todatetime("2008-01-11 "));

dates.add(convert.todatetime("2008-02-12 "));

lp.abscissadata = dates;

//柱狀

barplot storegrowth = new barplot();

storegrowth.abscissadata = dates;

storegrowth.ordinatedatatop = a;

storegrowth.ordinatedatabottom = ab;

storegrowth.fillbrush = nplot.rectanglebrushes.solid.red;

//storegrowth.borderpen = new pen( color.black, 2.0f );

myplot.add(storegrowth);

//標籤

labelpointplot tp1 = new labelpointplot();

tp1.abscissadata = dates;

tp1.ordinatedata  = a;

tp1.textdata = b;

tp1.labeltextposition = labelpointplot.labelpositions.above;

tp1.marker = new marker(marker.markertype.none, 10);

myplot.add(tp1);

//lp.

lp.datasource = a;

lp.pen = new pen(color.blue, 3.0f);

lp.label = "gaussian function";

myplot.add(lp);

myplot.xaxis1.label = "時間";

myplot.yaxis1.label = "次數";

//myplot.xaxis1.worldlength = 60 * 60 * 24;

//設定網格距離

//myplot.xaxis1.worldmin += myplot.xaxis1.worldlength/ 12;//worldlength=n*24*60*60;

//myplot.xaxis1.worldmax -= myplot.xaxis1.worldlength / 2;

//myplot.xaxis1.

//myplot.xaxis1.worldlength = 10;

//myplot.

//讓日期斜45度。

myplot.xaxis1.tickslabelangle = 45;

//下面**可讓窗體移動begin;

myplot.addinteraction(new nplot.windows.plotsu***ce2d.interactions.horizontaldrag());

//myplot.addinteraction(new nplot.windows.plotsu***ce2d.interactions.verticaldrag());

myplot.addinteraction(new nplot.windows.plotsu***ce2d.interactions.axisdrag(true));

myplot.refresh();

頂點法線和面法線

在3d世界中每乙個頂點都有顏色,除了使用光源和物體的材質資訊之外,還需要知道每個頂點的法向量,根據光照入射方向和法向量的夾角,計算頂點的最終顏色.那麼我們來了解下頂點法線.頂點法線 每乙個頂點都有法向量,就能知道光線到達物體表面的入射角.面法線 垂直乙個平面的直線叫麵法線 一般情況下頂點法線和面法線...

Thread的join的用法(執行緒執行排序)

執行緒必須要先start,才能join,只有啟動了,才能對執行緒進行操作。如有乙個執行緒叫a,那麼請看以下示例 a.start 啟動a執行緒 a.join 邀請a執行緒先執行,本執行緒先暫停執行,等待a執行緒執行完後,主線程再接著往下執行 system.out.println ok 這句話,要等到a...

Unity 法線翻轉

直接上乾貨 vector3 normals line.getcomponent mesh normals for int i 0 i normals.length i line.getcomponent mesh normals normals int s line.getcomponent mes...