-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
97 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ dependencies: | |
- numpy | ||
- pandas | ||
- bqplot | ||
- jupyter_sphinx | ||
- nbsphinx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Usage\n", | ||
"\n", | ||
"## Examples\n", | ||
"\n", | ||
"Using the pyplot API" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"from bqplot import pyplot as plt\n", | ||
"\n", | ||
"plt.figure(1, title='Line Chart')\n", | ||
"np.random.seed(0)\n", | ||
"n = 200\n", | ||
"x = np.linspace(0.0, 10.0, n)\n", | ||
"y = np.cumsum(np.random.randn(n))\n", | ||
"plt.plot(x, y)\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Using the bqplot internal object model" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"from IPython.display import display\n", | ||
"from bqplot import (\n", | ||
"OrdinalScale, LinearScale, Bars, Lines, Axis, Figure\n", | ||
")\n", | ||
"\n", | ||
"size = 20\n", | ||
"np.random.seed(0)\n", | ||
"\n", | ||
"x_data = np.arange(size)\n", | ||
"\n", | ||
"x_ord = OrdinalScale()\n", | ||
"y_sc = LinearScale()\n", | ||
"\n", | ||
"bar = Bars(x=x_data, y=np.random.randn(2, size), scales={'x': x_ord, 'y':\n", | ||
"y_sc}, type='stacked')\n", | ||
"line = Lines(x=x_data, y=np.random.randn(size), scales={'x': x_ord, 'y': y_sc},\n", | ||
" stroke_width=3, colors=['red'], display_legend=True, labels=['Line chart'])\n", | ||
"\n", | ||
"ax_x = Axis(scale=x_ord, grid_lines='solid', label='X')\n", | ||
"ax_y = Axis(scale=y_sc, orientation='vertical', tick_format='0.2f',\n", | ||
" grid_lines='solid', label='Y')\n", | ||
"\n", | ||
"Figure(marks=[bar, line], axes=[ax_x, ax_y], title='API Example',\n", | ||
" legend_location='bottom-right')" | ||
] | ||
} | ||
], | ||
"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.7.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file was deleted.
Oops, something went wrong.