waterfall: shifted lineplot

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

waterfall: shifted lineplot

Barth
Dear all,

For my application, i need to be able to create a waterfall plot. I have read the propositions in https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/advanced/spec_waterfall.py?rev=26201, but it does not suit to my needs, as it requires all the data of the different plots to be of the same length, which will not be the case for me. 

I see two ways to do that: 

First: create a "ShiftedLinePlot" class, that inherits from "lineplot", and overwrite the methods map_screen and map_data. 

I was wondering if there was not another possibility: simply modify the LinearMapper used for index_mapper and value_mapper. I thought reading the code of the class that only 

I have tried plotting a gaussian whose y values are between 0 and 1. 

To realize the shift, i do: 

#Creation of the Plot
newplot=self.plot.plot((x_name,y_name), type=type, color=color,name=plotname)
# Shift
newplot[0].value_mapper.low_pos=newplot[0].value_mapper.low_pos+1.0
newplot[0].value_mapper.high_pos=newplot[0].value_mapper.high_pos+1.0
# Redraw
self.plot.request_redraw()

But this does not seem to work: my gaussian is still plotted with no shift between 0 and 1. 

What is wrong with that approach ? 

Pierre

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev