[vtkusers] Remove all plots from vtkChartXY

Eric E. Monson emonson at cs.duke.edu
Tue Aug 16 09:17:09 EDT 2011


Well, it depends on the effect you want. When I try chart->ClearPlots() it seems to clear out everything, so there aren't any labels, either. If you have the axes autoscaling, then I don't think there is any way to clear the tick labels since it is always trying to set some sort of range. You can set manual tick positions and labels and just have empty arrays when you make the calls to axis->SetTickPositions() and ->SetTickLabels() and the axes won't have tick labels. (Both of those calls do an axis->SetBehavior(2) behind the scenes.) If you're talking about the label for the axis itself (axis title), then I think you have to just feed it an empty string.

-Eric


On Aug 16, 2011, at 7:51 AM, Jothy wrote:

> Thanks very much Eric, it works!
> 
> is there any way to clear the axis labels, there is no clear in chart->GetAxis(vtkAxis::LEFT)
> 
> Thanks again
> 
> Jothy
> 
> 
> On Tue, Aug 16, 2011 at 12:15 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
> If I'm understanding correctly what you're trying to do, you should be able to call 
> 
> chart->ClearPlots();
> 
> -Eric
> 
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
> 
> 
> On Aug 15, 2011, at 10:23 AM, Jothy wrote:
> 
>> Hi all,
>> 
>> I have rendered few line plots using vtkChartXY. But I want to replot some of the data. I looks like it replots everything including X&Y labels. I tried calling 
>> 
>> contextView->GetRenderer()->RemoveAllViewProps();
>> 
>> But it doesn't work!
>> 
>> My loop is somehting like this
>> 
>> vtkSmartPointer<vtkChartXY> chart =
>>              vtkSmartPointer<vtkChartXY>::New();
>> 
>> for (int x=0;x<10;x++)
>>     {
>> vtkPlot *line = chart->AddPlot(vtkChart::LINE);
>>       line->SetInput(table, 0, 1);
>> }
>> 
>> contextview->GetInteractor()->Initialize();
>> contextView->view->GetInteractor()->Start();
>> 
>> Any suggestions?
>> 
>> Thanks
>> 
>> Jothy
>> 
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110816/e8ca04c7/attachment.htm>


More information about the vtkusers mailing list