0

I am trying to change the axes Min and Max properties to show only the plot points that lie in a particular range.

say If I have lineplot whose X values are ranging from 0 to 100, I want to display only the values that are greater than 50.However I noticed that the lineplot is drawn using all the position points.Only the x axis ticks got renamed such that they start from 50 and end at 100.

The following is the code I am using

var axes = m_plotCube.First<ILAxisCollection>();
if (axes != null)
{
 ILAxis xAxis = axes.Where<ILAxis>(item => item.Label.Text == "X Axis").First();
 xAxis.Min = 50;
 xAxis.Max = 100;
 xAxis.Configure();
}

Am I missing something ?

Neelima
  • 243
  • 1
  • 8
  • I figured out that the trick is to use the plot cube limits intead of axis limits.but stuck with another issue. If I use the plotcube reference obtained by find query, there is no effect. – Neelima Mar 18 '14 at 12:14
  • ILPlotCube pc = new ILPlotCube {new ILLinePlot(A.T)}; ILScene scene = new ILScene(); scene.Add(pc); ilPanel2.Scene = scene; // DOES NOT WORK //var testPC = ilPanel1.Scene.Find – Neelima Mar 18 '14 at 12:18
  • please open a new question for the new issue! – user492238 Mar 18 '14 at 12:56

1 Answers1

1

Use ILPlotCube.Limits instead:

var pc = ilPanel1.Scene.First<ILPlotCube>();
pc.Limits.Set(
    new Vector3(50, pc.Limits.YMin, pc.Limits.ZMin),
    new Vector3(100, pc.Limits.YMax, pc.Limits.ZMax)); 

BTW: the axes are accessed much easier: plotcube.Axes.XAxis ...

user492238
  • 4,094
  • 1
  • 20
  • 26