When I plot data with ILPlotCube, the (0,0) origin is displayed with some offset (margin/gap) from the x and y axes. How can I remove this offset?
Asked
Active
Viewed 71 times
1 Answers
2
You can use the ILLimits.Set
For example:
var start = -2;
var sz = 6;
ILArray<float> x = Enumerable.Range(start, sz).ToArray();
var pc = new ILPlotCube(twoDMode: true)
{
new ILLinePlot(x)
};
pc.Limits.Set(new Vector3(0, start + sz - 1, 0), new Vector3(sz - 1, start, 0));
Added (01/12/2016)
My understanding was: you want to get rid of the space noted in the red circle? Get rid of red circle Also changed the code a bit.

evertqin
- 70
- 5
-
Thanks Roger. My data is negative and positive (x in your example). but at the moment when I plot the data, a point at (0,0) coordinate of data is not match with (0,0) of x and Y axis ( there is a gap/Margin). Does above answer cover this or you are restricting data between 0 and 5 will be only displayed? – james Jan 12 '16 at 09:56
-
@james, please see the image in my update. To get rid of that space, you need to manually set the limits of your plot area. Maybe my understanding was wrong. – evertqin Jan 12 '16 at 15:00
-
Thanks. your understand was correct. I wanted to get ride of red circle. – james Jan 18 '16 at 09:10