Data display to 1DQwtPlot after it was connected to a LineCut

Issue #30 resolved
kraagg created an issue

When an existing 1dQWT Plot is connected to a 2D Plot as LinePlotItem there is an error with the displayed data, when the source is set manually. Displaying a lineplot works fine. But if one is setting new data as source via the plot property, the new source is only displayed in the y range of the connected LinePlot. It seems like the plot is not rescalled. But a manual rescale also don´t work, as only in the new data is only written to the plot in the existing range. A python script with an example is added. In the example, the data d2 is only displayed in a small range. And not the complete data.

Comments (2)

  1. M. Gronle

    fixes issue #30: if an itom1dqwtplot is currently connected to the line cut / z-stack cut functionality of an itom2dqwtplot and the user assigns a new, different source to the source property of the line cut, the input parameters 'bounds' are resetted now, to fully display the newly given dataObject. However: the connection to the 2d plot is still there, hence, if the user draws a new line / z-stack position, this line is drawn again in the 1d plot. Avoid this by resetting the connection before assigning a new source object. This is done by assigning None to the properties 'lineCutPlotItem' / 'zSlicePlotItem' of the 2d plot.

    → <<cset 1096298536a3>>

  2. M. Gronle

    Hey David,

    it would be better if you extend your example to this:

    import time
    
    d2d = dataObject().rand((1000,1000))
    d1 = dataObject().ones((100,1))
    d2 = dataObject().ones((400,1))*5
    d2[100:300,0] = 6
    
    h1=plot(d2d)[1]
    h2=plot(d1)[1]
    h1["lineCutPlotItem"] = h2
    h1.call("setLinePlot",20,24,10,80)
    
    time.sleep(2)
    
    h1["lineCutPlotItem"] = None #this is optional, however recommended
    h2["source"] = d2
    

    If you do not disconnect the 1d plot from the lineCutPlotItem property of the 2d plot, this connection would still be possible. Hence, a change in the line cut will replot this line in the 1d plot (and the rescale-to-parent button becomes visible again). Therefore it would be better to disconnect the 1d plot from the 2d plot before assigning a new source.

    I hope that this is OK, because it is currently not possible that the 2d plot gets automatically informed if the 1d plot has another “designated use”.

    Cheers

    Marc

  3. Log in to comment