diff options
Diffstat (limited to 'doc/InteractivePlotter.ipynb')
-rw-r--r-- | doc/InteractivePlotter.ipynb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/doc/InteractivePlotter.ipynb b/doc/InteractivePlotter.ipynb index 0405102..01cc103 100644 --- a/doc/InteractivePlotter.ipynb +++ b/doc/InteractivePlotter.ipynb @@ -479,6 +479,52 @@ "prompt_number": null }, { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is also possible to define a colour map to associate a specific colour to each event. A colour string can be:\n", + "\n", + " - a colour name, `green`, `red`, `blue`, etc.\n", + " \n", + " - the HEX representation of the colour, `#0000FF` for blue, `#FF0000` for red\n", + " " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Using colour names\n", + "trappy.EventPlot(EVENTS,\n", + " keys=EVENTS.keys, # Name of the Process Element\n", + " lanes=[\"zero\", 1, \"two\", \"three\"],\n", + " domain=[0,5], # Time Domain\n", + " color_map={\"A\" : \"blue\", \"B\" : \"red\", \"C\" : \"green\"}\n", + " ).view()" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": null + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Using HEX representation of colours\n", + "trappy.EventPlot(EVENTS,\n", + " keys=EVENTS.keys, # Name of the Process Element\n", + " lanes=[\"zero\", 1, \"two\", \"three\"],\n", + " domain=[0,5], # Time Domain\n", + " color_map={\"A\" : \"\t#ffa07a\", \"B\" : \"#f08080\", \"C\" : \"#add8e6\"}\n", + " ).view()" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": null + }, + { "cell_type": "heading", "level": 1, "metadata": {}, |