aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2016-07-20 19:28:39 +0100
committerMichele Di Giorgio <michele.digiorgio@arm.com>2016-07-20 19:28:39 +0100
commit303610e53c9293aa6db3e542c50a55fa0b4988e9 (patch)
tree0acc96b79de14f147fd20a82fb81fd80dff9bc40
parentf9c81a71180f1092bdcc71b5a6ed091f9b7fd950 (diff)
downloadtrappy-303610e53c9293aa6db3e542c50a55fa0b4988e9.tar.gz
doc: add examples for colour map in EventPlot
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
-rw-r--r--doc/InteractivePlotter.ipynb46
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": {},