1D Qwt Plot: wrong legendTitle-tag if dataObject is a ROI (slice) of a bigger dataObject

Create issue
Issue #15 resolved
M. Gronle created an issue

In the itom1dqwtplot, the legend checks if the dataObject has tags defined with the names legendTitle0, legendTitle1, legendTitle2... If this is the case, the legend entries automatically get the values assigned to these tag-keys.

If however, the dataObject is a ROI of another dataObject, the legend titles are wrongly assigned, since the first line still uses the tag legendTitle0, however the real tag could be something like legendTitle1.

This can be fixed if one checks the m_roi member of the dataObject in order to check how many "invisible" rows are prepended to that ROI such that the real legendTitleXX-keyword can be assumed by this.

Comments (4)

  1. M. Gronle reporter


    a = dataObject.randN([5,10], 'float32')
    a.setTag("legendTitle0", "Graph 0")
    a.setTag("legendTitle1", "Graph 1")
    a.setTag("legendTitle2", "Graph 2")
    a.setTag("legendTitle3", "Graph 3")
    a.setTag("legendTitle4", "Graph 4")
    plot1(a, properties = {"legendPosition":"Right"})
    plot1(a[1:,:], properties = {"legendPosition":"Right"}) #first line get legend title 'Graph 1' instead of 'Graph 0'
  2. Log in to comment