[vtkusers] vtkChartXY How to remove a specific vtkPlot in it?

Guan, Xuefei xf.guan at gmail.com
Sat Aug 3 09:39:25 EDT 2013


Hi Alexandre, Thanks for your notes, it works perfectly.


On Fri, Aug 2, 2013 at 11:01 PM, Alexandre Boucher <afboucher at gmail.com>wrote:

> I normally use
>
> pcChartXY->RemovePlotInstance(pcPlot)
>
> However I had strange behavior when I try to add and remove plot in corner
> 0 (see here:
> http://vtk.1045678.n5.nabble.com/vtkChartXY-Cannot-add-and-then-remove-vtkPlotBar-from-corner-0-VTK6-0-td5722329.html
> )
>
>
>
>
> On Fri, Aug 2, 2013 at 7:21 PM, Guan, Xuefei <xf.guan at gmail.com> wrote:
>
>> Dear VTK users,
>>
>> I browsed the vtkChartXY function lists, the only available function to
>> remove a line in it is by RemovePlot(vtkIdType)
>>
>> My question is how to get the index from an existing vtkPlot *,
>>
>> For example, I use the following snip and a for loop to draw a large set
>> of lines
>>
>> vtkPlot* pcPlot = m_pcChartXY->AddPlot(vtkChart::LINE);
>>  pcPlot->SetColor(r, g, b);
>> pcPlot->SetWidth(1);
>> pcPlot->SetInput(pcDataTable, i, j);
>>  pcPlot->SetLabel("");
>>
>> Then I want to delete a specific line in the chart, how to do that using
>> a given vtkPlot* pcPlot? Or if I want to use RemovePlot(vtkIdType) to
>> delete a specific line, how to get the required index from a given vtkPlot*
>> pcPlot?
>>
>> Is the line id is a linear integer starting from 0?
>>
>> Thanks for your help.
>>
>> Regards,
>> xf.
>>
>> _______________________________________________
>> 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/20130803/64e9f757/attachment.htm>


More information about the vtkusers mailing list