{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "absent-finish", "metadata": {}, "outputs": [], "source": [ "from bqplot import *\n", "\n", "import numpy as np\n", "import pandas as pd\n", "\n", "np.random.seed(0)\n", "y1 = np.cumsum(np.random.randn(150)) + 100.\n", "y2 = np.cumsum(np.random.randn(150)) + 100.\n", "y3 = np.cumsum(np.random.randn(150)) + 100.\n", "y4 = np.cumsum(np.random.randn(150)) + 100.\n", "\n", "sc_x = LinearScale()\n", "sc_y = LinearScale()\n", "\n", "lines = Lines(x=np.arange(len(y1)), y=[y1, y2, y3, y4],\n", " scales={'x': sc_x, 'y': sc_y})\n", "ax_x = Axis(scale=sc_x, label='Index')\n", "ax_y = Axis(scale=sc_y, orientation='vertical', label='lines')\n", "\n", "Figure(marks=[lines], axes=[ax_x, ax_y], title='Lines')" ] }, { "cell_type": "code", "execution_count": null, "id": "underlying-wrist", "metadata": {}, "outputs": [], "source": [ "lines.colors = ['red', 'green']" ] }, { "cell_type": "code", "execution_count": null, "id": "conscious-workshop", "metadata": {}, "outputs": [], "source": [ "lines.colors = ['red', 'blue', 'green', 'purple']" ] }, { "cell_type": "code", "execution_count": null, "id": "differential-neighbor", "metadata": {}, "outputs": [], "source": [ "lines.opacities = [0.5, 0.8]" ] }, { "cell_type": "code", "execution_count": null, "id": "equal-kingdom", "metadata": {}, "outputs": [], "source": [ "lines.fill = 'bottom'" ] }, { "cell_type": "code", "execution_count": null, "id": "placed-terminology", "metadata": {}, "outputs": [], "source": [ "lines.fill = 'top'" ] }, { "cell_type": "code", "execution_count": null, "id": "miniature-eclipse", "metadata": {}, "outputs": [], "source": [ "lines.opacities = [1, 0.4]" ] }, { "cell_type": "code", "execution_count": null, "id": "social-folder", "metadata": {}, "outputs": [], "source": [ "lines.fill_opacities = [0.2, 0.3, 0.5, 0.4]" ] }, { "cell_type": "code", "execution_count": null, "id": "expanded-foundation", "metadata": {}, "outputs": [], "source": [ "lines.line_style = 'dashed'" ] }, { "cell_type": "code", "execution_count": null, "id": "dried-appliance", "metadata": {}, "outputs": [], "source": [ "lines.interpolation = 'basis'" ] }, { "cell_type": "code", "execution_count": null, "id": "packed-operator", "metadata": {}, "outputs": [], "source": [ "lines.marker = 'circle'" ] } ], "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 }