Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathExample2.cs
More file actions
Latest commit
40 lines (34 loc) · 1.27 KB
/
Copy pathExample2.cs
File metadata and controls
40 lines (34 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
usingstaticpbPlots;
usingstaticSupportLib;
usingSystem;
publicclassExample2{
publicstaticvoidMain2(){
boolsuccess;
RGBABitmapImageReferenceimageReference=CreateRGBABitmapImageReference();
StringReferenceerrorMessage=newStringReference();
ScatterPlotSeriesseries=GetDefaultScatterPlotSeriesSettings();
series.xs=newdouble[]{-2,-1,0,1,2};
series.ys=newdouble[]{2,-1,-2,-1,2};
series.linearInterpolation=true;
series.lineType="dashed".ToCharArray();
series.lineThickness=2d;
series.color=GetGray(0.3);
ScatterPlotSettingssettings=GetDefaultScatterPlotSettings();
settings.width=600;
settings.height=400;
settings.autoBoundaries=true;
settings.autoPadding=true;
settings.title="x^2 - 2".ToCharArray();
settings.xLabel="X axis".ToCharArray();
settings.yLabel="Y axis".ToCharArray();
settings.scatterPlotSeries=newScatterPlotSeries[]{series};
success=DrawScatterPlotFromSettings(imageReference,settings,errorMessage);
if(success){
double[]pngdata=ConvertToPNG(imageReference.image);
WriteToFile(pngdata,"example2.png");
DeleteImage(imageReference.image);
}else{
Console.Error.WriteLine(errorMessage.stringx);
}
}
}