| 1 |
{ |
| 2 |
"cells": [ |
| 3 |
{ |
| 4 |
"cell_type": "code", |
| 5 |
"execution_count": null, |
| 6 |
"id": "eb6303b2", |
| 7 |
"metadata": {}, |
| 8 |
"outputs": [], |
| 9 |
"source": [ |
| 10 |
"import numpy as np\n", |
| 11 |
"import bqplot.pyplot as plt\n", |
| 12 |
"from bqplot import *\n", |
| 13 |
"\n", |
| 14 |
"np.random.seed(0)\n", |
| 15 |
"\n", |
| 16 |
"fig = plt.figure(title='Multiple Marks')\n", |
| 17 |
"\n", |
| 18 |
"# create multiple marks. they'll be added to the same figure\n", |
| 19 |
"bar_chart = plt.bar([1, 2, 3, 4, 5], [2, 9, 10, 40, 40])\n", |
| 20 |
"line_chart = plt.plot([1, 2, 3, 4, 5], [10, 5, 30, 60, 20], 'rs-')\n", |
| 21 |
"\n", |
| 22 |
"fig" |
| 23 |
] |
| 24 |
}, |
| 25 |
{ |
| 26 |
"cell_type": "code", |
| 27 |
"execution_count": null, |
| 28 |
"id": "d2a8ea8a", |
| 29 |
"metadata": {}, |
| 30 |
"outputs": [], |
| 31 |
"source": [ |
| 32 |
"fig = plt.figure(title='Histogram')\n", |
| 33 |
"hist = plt.hist(sample=np.random.randn(100), bins=10, colors=['orange'])\n", |
| 34 |
"fig" |
| 35 |
] |
| 36 |
}, |
| 37 |
{ |
| 38 |
"cell_type": "code", |
| 39 |
"execution_count": null, |
| 40 |
"id": "dde7e10c", |
| 41 |
"metadata": {}, |
| 42 |
"outputs": [], |
| 43 |
"source": [ |
| 44 |
"fig = plt.figure()\n", |
| 45 |
"line = plt.plot(np.arange(100), np.random.randn(100).cumsum(), 'r')\n", |
| 46 |
"fig" |
| 47 |
] |
| 48 |
} |
| 49 |
], |
| 50 |
"metadata": { |
| 51 |
"kernelspec": { |
| 52 |
"display_name": "Python 3", |
| 53 |
"language": "python", |
| 54 |
"name": "python3" |
| 55 |
}, |
| 56 |
"language_info": { |
| 57 |
"codemirror_mode": { |
| 58 |
"name": "ipython", |
| 59 |
"version": 3 |
| 60 |
}, |
| 61 |
"file_extension": ".py", |
| 62 |
"mimetype": "text/x-python", |
| 63 |
"name": "python", |
| 64 |
"nbconvert_exporter": "python", |
| 65 |
"pygments_lexer": "ipython3", |
| 66 |
"version": "3.9.2" |
| 67 |
} |
| 68 |
}, |
| 69 |
"nbformat": 4, |
| 70 |
"nbformat_minor": 5 |
| 71 |
} |