[vtkusers] Smoothing 2D plot in ChartXY

Yuri Timenkov yuri at timenkov.ru
Thu Jul 7 11:10:43 EDT 2011


Hello Marcus,

Thank you for response and for great job: new chart API is much easier to
use than old one. However VTK is still quite complex and more oriented for
3d rendering (including parallel processing).

Since I don't have tight  CPU constraints for this project I chose python
over C++. For initial prototype python is much better since it doesn't need
to be compiled and moreover provides interactivity. Also it has good 2d
plotting alternatives. For my purposes I picked matplotlib (moreover, it
allows to have 2 axes on the same plot:
http://matplotlib.sourceforge.net/examples/api/two_scales.html) and numpy's
convolution routine (http://www.scipy.org/Cookbook/SignalSmooth) makes it
easy to fit whole program into a half of screen.

Regards,
Yuri

On Wed, Jun 29, 2011 at 7:46 PM, Marcus D. Hanwell <
marcus.hanwell at kitware.com> wrote:

> On Thu, Jun 23, 2011 at 10:46 AM, Yuri Timenkov <yuri at timenkov.ru> wrote:
> > Hello,
> > I have a raw set of 2D data from vtkTable using new vtkChartXY API
> (function
> > in time). But it has a lot of peaks and falls and too much details (see
> > example in attachment). I want to make it look niceer, so I see 3
> options:
> >
> > Draw every Nth point.
> > Reduce number of points my averaging adjacent values.
> > Draw kind of envelope.
> >
> > Does VTK provide any means to do it automatically or I have to prepare
> data
> > somehow before plotting?
>
> I am not aware of any filters that do that, but this kind of thing
> could be made into a filter. It would be good to get a few of the
> commonly used algorithms encapsulated into some filters for treating
> chart data, and the pipeline would be the right place to do it.
>
> Marcus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110707/42064d7c/attachment.htm>


More information about the vtkusers mailing list