{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 1D Legend title\n\nThis demo shows how to define ``dataObject`` tags, which are used \nas ``legendTitles`` in the 1D plot. You have to set the tags ``legendTitle0``\n``legendTitle1``, ``legendTitle2``, ..., according to the curve index and\nthe legend label text. \n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from itom import dataObject\nfrom itom import plot1\n\ndObj = dataObject.rand([2, 100])\ndObj.setTag(\"legendTitle0\", \"title of the first curve\")\ndObj.setTag(\"legendTitle1\", \"title of the second curve\")\n\nprint(dObj.tags)\nplot1(dObj, properties={\"legendPosition\": \"Right\"})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 0 }