{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "eb6303b2", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import bqplot.pyplot as plt\n", "from bqplot import *\n", "\n", "np.random.seed(0)\n", "\n", "fig = plt.figure(title='Multiple Marks')\n", "\n", "# create multiple marks. they'll be added to the same figure\n", "bar_chart = plt.bar([1, 2, 3, 4, 5], [2, 9, 10, 40, 40])\n", "line_chart = plt.plot([1, 2, 3, 4, 5], [10, 5, 30, 60, 20], 'rs-')\n", "\n", "fig" ] }, { "cell_type": "code", "execution_count": null, "id": "d2a8ea8a", "metadata": {}, "outputs": [], "source": [ "fig = plt.figure(title='Histogram')\n", "hist = plt.hist(sample=np.random.randn(100), bins=10, colors=['orange'])\n", "fig" ] }, { "cell_type": "code", "execution_count": null, "id": "dde7e10c", "metadata": {}, "outputs": [], "source": [ "fig = plt.figure()\n", "line = plt.plot(np.arange(100), np.random.randn(100).cumsum(), 'r')\n", "fig" ] } ], "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.9.2" } }, "nbformat": 4, "nbformat_minor": 5 }