12.1.10.5.2. 1D Legend title

This demo shows how to define dataObject tags, which are used as legendTitles in the 1D plot. You have to set the tags legendTitle0 legendTitle1, legendTitle2, …, according to the curve index and the legend label text.

from itom import dataObject
from itom import plot1

dObj = dataObject.rand([2, 100])
dObj.setTag("legendTitle0", "title of the first curve")
dObj.setTag("legendTitle1", "title of the second curve")

print(dObj.tags)
plot1(dObj, properties={"legendPosition": "Right"})
{'legendTitle0': 'title of the first curve', 'legendTitle1': 'title of the second curve'}

(123, PlotItem(UiItem(class: Itom1DQwtPlot, name: plot0x0)))
../../../_images/demoPlot1DLegendTitle_1.png

Total running time of the script: ( 0 minutes 0.131 seconds)