From 303610e53c9293aa6db3e542c50a55fa0b4988e9 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Wed, 20 Jul 2016 19:28:39 +0100 Subject: doc: add examples for colour map in EventPlot Signed-off-by: Michele Di Giorgio --- doc/InteractivePlotter.ipynb | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/doc/InteractivePlotter.ipynb b/doc/InteractivePlotter.ipynb index 0405102..01cc103 100644 --- a/doc/InteractivePlotter.ipynb +++ b/doc/InteractivePlotter.ipynb @@ -478,6 +478,52 @@ "outputs": [], "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, -- cgit v1.2.3