Debian Codegraph @

bqplot/ui-tests/tests/notebooks/lines_update.ipynb

raw
1 {
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": null,
6 "id": "absent-finish",
7 "metadata": {},
8 "outputs": [],
9 "source": [
10 "from bqplot import *\n",
11 "\n",
12 "import numpy as np\n",
13 "import pandas as pd\n",
14 "\n",
15 "np.random.seed(0)\n",
16 "y1 = np.cumsum(np.random.randn(150)) + 100.\n",
17 "y2 = np.cumsum(np.random.randn(150)) + 100.\n",
18 "y3 = np.cumsum(np.random.randn(150)) + 100.\n",
19 "y4 = np.cumsum(np.random.randn(150)) + 100.\n",
20 "\n",
21 "sc_x = LinearScale()\n",
22 "sc_y = LinearScale()\n",
23 "\n",
24 "lines = Lines(x=np.arange(len(y1)), y=[y1, y2, y3, y4],\n",
25 " scales={'x': sc_x, 'y': sc_y}, apply_clip = False)\n",
26 "ax_x = Axis(scale=sc_x, label='Index')\n",
27 "ax_y = Axis(scale=sc_y, orientation='vertical', label='lines')\n",
28 "\n",
29 "Figure(marks=[lines], axes=[ax_x, ax_y], title='Lines')"
30 ]
31 },
32 {
33 "cell_type": "code",
34 "execution_count": null,
35 "id": "underlying-wrist",
36 "metadata": {},
37 "outputs": [],
38 "source": [
39 "lines.colors = ['red', 'green']"
40 ]
41 },
42 {
43 "cell_type": "code",
44 "execution_count": null,
45 "id": "conscious-workshop",
46 "metadata": {},
47 "outputs": [],
48 "source": [
49 "lines.colors = ['red', 'blue', 'green', 'purple']"
50 ]
51 },
52 {
53 "cell_type": "code",
54 "execution_count": null,
55 "id": "differential-neighbor",
56 "metadata": {},
57 "outputs": [],
58 "source": [
59 "lines.opacities = [0.5, 0.8]"
60 ]
61 },
62 {
63 "cell_type": "code",
64 "execution_count": null,
65 "id": "equal-kingdom",
66 "metadata": {},
67 "outputs": [],
68 "source": [
69 "lines.fill = 'bottom'"
70 ]
71 },
72 {
73 "cell_type": "code",
74 "execution_count": null,
75 "id": "placed-terminology",
76 "metadata": {},
77 "outputs": [],
78 "source": [
79 "lines.fill = 'top'"
80 ]
81 },
82 {
83 "cell_type": "code",
84 "execution_count": null,
85 "id": "miniature-eclipse",
86 "metadata": {},
87 "outputs": [],
88 "source": [
89 "lines.opacities = [1, 0.4]"
90 ]
91 },
92 {
93 "cell_type": "code",
94 "execution_count": null,
95 "id": "social-folder",
96 "metadata": {},
97 "outputs": [],
98 "source": [
99 "lines.fill_opacities = [0.2, 0.3, 0.5, 0.4]"
100 ]
101 },
102 {
103 "cell_type": "code",
104 "execution_count": null,
105 "id": "expanded-foundation",
106 "metadata": {},
107 "outputs": [],
108 "source": [
109 "lines.line_style = 'dashed'"
110 ]
111 },
112 {
113 "cell_type": "code",
114 "execution_count": null,
115 "id": "dried-appliance",
116 "metadata": {},
117 "outputs": [],
118 "source": [
119 "lines.interpolation = 'basis'"
120 ]
121 },
122 {
123 "cell_type": "code",
124 "execution_count": null,
125 "id": "packed-operator",
126 "metadata": {},
127 "outputs": [],
128 "source": [
129 "lines.marker = 'circle'"
130 ]
131 },
132 {
133 "cell_type": "code",
134 "execution_count": null,
135 "id": "384540e9-2d64-4508-827f-1f6d6aedd268",
136 "metadata": {},
137 "outputs": [],
138 "source": [
139 "lines.labels_visibility = 'label'"
140 ]
141 },
142 {
143 "cell_type": "code",
144 "execution_count": null,
145 "id": "7444d361-f8f3-4641-88ef-fbe84450bfb3",
146 "metadata": {},
147 "outputs": [],
148 "source": [
149 "lines.x, lines.y = [], []"
150 ]
151 },
152 {
153 "cell_type": "code",
154 "execution_count": null,
155 "id": "481f09e7-f7a9-4393-8388-a608b216ef41",
156 "metadata": {},
157 "outputs": [],
158 "source": [
159 "lines.x, lines.y = np.arange(len(y1)), [y1, y2, y3, y4]"
160 ]
161 }
162 ],
163 "metadata": {
164 "kernelspec": {
165 "display_name": "Python 3",
166 "language": "python",
167 "name": "python3"
168 },
169 "language_info": {
170 "codemirror_mode": {
171 "name": "ipython",
172 "version": 3
173 },
174 "file_extension": ".py",
175 "mimetype": "text/x-python",
176 "name": "python",
177 "nbconvert_exporter": "python",
178 "pygments_lexer": "ipython3",
179 "version": "3.9.2"
180 }
181 },
182 "nbformat": 4,
183 "nbformat_minor": 5
184 }