I'm trying to scale the xaxis of an LinePlot. Every value of x has to be divided by 50, because the data is from a measurment of 50hz.
The xRange is about [0,ca.7000], and shall be [0,1/50,2/50,...,7000/50] as scaled x-axis. Sadly, I cannot post an image, need more reputations...
The C# code is:
private void ilPanel1_Load(object sender, EventArgs e)
{
Windpark windpark = new Windpark(quelldatei,hz,anzFreq);
float[] a = windpark.readData();
float[] b = windpark.mittelwertAbzug(a);
ILArray<float> B = ILMath.array(b);
ILArray<float> Fit = ILMath.convert<double, float>(windpark.findeFit(B));
var scene = new ILScene {
new ILPlotCube {
new ILLinePlot(Fit.T, lineColor: Color.Blue,lineWidth:2),
new ILLinePlot(B.T, lineColor: Color.Yellow)
}
};
ilPanel1.Scene = scene;
}
I tried to use the CrateTicksAuto() Method, but don't know how to use it
public static List<float> CreateTicksAuto(
float min,
float max,
int numberTicks
)
I'd be very thankful for any help!
Best regards
Christian
Solved the problem... I made the ticks as described in here. It makes ten ticks in steps of (array.length/10). My solution looks like this:
private void ilPanel1_Load(object sender, EventArgs e)
{
Windpark windpark = new Windpark(quelldatei,hz,anzFreq);
float[] a = windpark.readData();
float[] b = windpark.mittelwertAbzug(a);
ILArray<float> B = ILMath.array(b);
ILArray<float> Fit = ILMath.convert<double, float>(windpark.findeFit(B));
var scene = new ILScene() ;
var plotCube =scene.Add(new ILPlotCube {
new ILLinePlot(B.T, lineColor: Color.Yellow),
new ILLinePlot(Fit.T, lineColor: Color.Black,lineWidth:3)
});
for (int i = 0; i < Fit.Length; i =i+(int)ILMath.round((double)Fit.Length/ 10.0))
{
var tick = plotCube.Axes.XAxis.Ticks.Add(i, (i/hz).ToString());
}
ilPanel1.Scene = scene;
}
}