Skip to content

Commit 4fa3cc2

Browse files
committed
update demos
1 parent cfe2d88 commit 4fa3cc2

File tree

5 files changed

+327
-780
lines changed

5 files changed

+327
-780
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In order to run the notebooks you will also need to have `imageio` and `zarr` in
2020
### Install using pip
2121
```
2222
# other packages specifically used for this demo
23-
pip install "jupyterlab<4" imageio zarr
23+
pip install "jupyterlab<4" imageio zarr sidecar
2424
2525
# fastplotlib with notebook dependencies
2626
pip install "fastplotlib[notebook]"

gridplot.ipynb

+23-108
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 1,
15+
"execution_count": null,
1616
"id": "66eaaf8e-3324-4e77-9cc4-f52682c7caea",
1717
"metadata": {
1818
"tags": []
@@ -26,35 +26,12 @@
2626
},
2727
{
2828
"cell_type": "code",
29-
"execution_count": 2,
29+
"execution_count": null,
3030
"id": "e481359b-6b49-40c5-86dd-b1c177314cd6",
3131
"metadata": {
3232
"tags": []
3333
},
34-
"outputs": [
35-
{
36-
"data": {
37-
"application/vnd.jupyter.widget-view+json": {
38-
"model_id": "d91eb6c3eb7a4a4b9cfc1a20ddb2237b",
39-
"version_major": 2,
40-
"version_minor": 0
41-
},
42-
"text/plain": [
43-
"RFBOutputContext()"
44-
]
45-
},
46-
"metadata": {},
47-
"output_type": "display_data"
48-
},
49-
{
50-
"name": "stderr",
51-
"output_type": "stream",
52-
"text": [
53-
"/home/clewis7/repos/fastplotlib/fastplotlib/graphics/_features/_base.py:34: UserWarning: converting float64 array to float32\n",
54-
" warn(f\"converting {array.dtype} array to float32\")\n"
55-
]
56-
}
57-
],
34+
"outputs": [],
5835
"source": [
5936
"# GridPlot of shape 2 x 3 with all controllers synced\n",
6037
"grid_plot = fpl.GridPlot(shape=(2, 3), controllers=\"sync\")\n",
@@ -94,27 +71,12 @@
9471
},
9572
{
9673
"cell_type": "code",
97-
"execution_count": 3,
74+
"execution_count": null,
9875
"id": "ed86a89d-0cb9-44e6-97ac-56499c9a0a2e",
9976
"metadata": {
10077
"tags": []
10178
},
102-
"outputs": [
103-
{
104-
"data": {
105-
"text/plain": [
106-
"unnamed: Subplot @ 0x7f684a3c8110\n",
107-
" parent: fastplotlib.GridPlot @ 0x7f684a483890\n",
108-
"\n",
109-
" Graphics:\n",
110-
"\t'rand-img': ImageGraphic @ 0x7f684a483cd0"
111-
]
112-
},
113-
"execution_count": 3,
114-
"metadata": {},
115-
"output_type": "execute_result"
116-
}
117-
],
79+
"outputs": [],
11880
"source": [
11981
"# positional indexing\n",
12082
"# row 0 and col 0\n",
@@ -131,23 +93,12 @@
13193
},
13294
{
13395
"cell_type": "code",
134-
"execution_count": 4,
96+
"execution_count": null,
13597
"id": "bf671e47-70b7-428b-bfca-55123e99344d",
13698
"metadata": {
13799
"tags": []
138100
},
139-
"outputs": [
140-
{
141-
"data": {
142-
"text/plain": [
143-
"(<weakproxy at 0x7f67f43d4ea0 to ImageGraphic at 0x7f67f43d8550>,)"
144-
]
145-
},
146-
"execution_count": 4,
147-
"metadata": {},
148-
"output_type": "execute_result"
149-
}
150-
],
101+
"outputs": [],
151102
"source": [
152103
"grid_plot[0, 1].graphics"
153104
]
@@ -162,7 +113,7 @@
162113
},
163114
{
164115
"cell_type": "code",
165-
"execution_count": 5,
116+
"execution_count": null,
166117
"id": "2b9f4996-9321-488c-aa7d-99129a8a0dd0",
167118
"metadata": {
168119
"tags": []
@@ -182,90 +133,53 @@
182133
},
183134
{
184135
"cell_type": "code",
185-
"execution_count": 6,
136+
"execution_count": null,
186137
"id": "fb186973-1ce2-4361-bb97-0f50342f9861",
187138
"metadata": {
188139
"tags": []
189140
},
190141
"outputs": [],
191142
"source": [
192143
"# you can give subplots human-readable string names\n",
193-
"grid_plot[0, 2].name = \"top-right-plot\""
144+
"grid_plot[0, 2].name = \"top-right\""
194145
]
195146
},
196147
{
197148
"cell_type": "code",
198-
"execution_count": 7,
149+
"execution_count": null,
199150
"id": "403d2d0a-7cbf-4e43-a75a-dfff98d40cf2",
200151
"metadata": {
201152
"tags": []
202153
},
203-
"outputs": [
204-
{
205-
"data": {
206-
"text/plain": [
207-
"top-right-plot: Subplot @ 0x7f6844705c10\n",
208-
" parent: fastplotlib.GridPlot @ 0x7f684a483890\n",
209-
"\n",
210-
" Graphics:\n",
211-
"\t'rand-img': ImageGraphic @ 0x7f67f43da110"
212-
]
213-
},
214-
"execution_count": 7,
215-
"metadata": {},
216-
"output_type": "execute_result"
217-
}
218-
],
154+
"outputs": [],
219155
"source": [
220-
"grid_plot[\"top-right-plot\"]"
156+
"grid_plot[\"top-right\"]"
221157
]
222158
},
223159
{
224160
"cell_type": "code",
225-
"execution_count": 8,
161+
"execution_count": null,
226162
"id": "4f296891-a8b4-47d1-8d17-7554c36b00ed",
227163
"metadata": {
228164
"tags": []
229165
},
230-
"outputs": [
231-
{
232-
"data": {
233-
"text/plain": [
234-
"(0, 2)"
235-
]
236-
},
237-
"execution_count": 8,
238-
"metadata": {},
239-
"output_type": "execute_result"
240-
}
241-
],
166+
"outputs": [],
242167
"source": [
243168
"# view its position\n",
244-
"grid_plot[\"top-right-plot\"].position"
169+
"grid_plot[\"top-right\"].position"
245170
]
246171
},
247172
{
248173
"cell_type": "code",
249-
"execution_count": 9,
174+
"execution_count": null,
250175
"id": "85f06940-3eec-49e9-97a0-00054ad27d8a",
251176
"metadata": {
252177
"tags": []
253178
},
254-
"outputs": [
255-
{
256-
"data": {
257-
"text/plain": [
258-
"True"
259-
]
260-
},
261-
"execution_count": 9,
262-
"metadata": {},
263-
"output_type": "execute_result"
264-
}
265-
],
179+
"outputs": [],
266180
"source": [
267181
"# these are really the same\n",
268-
"grid_plot[\"top-right-plot\"] is grid_plot[0, 2]"
182+
"grid_plot[\"top-right\"] is grid_plot[0, 2]"
269183
]
270184
},
271185
{
@@ -278,25 +192,26 @@
278192
},
279193
{
280194
"cell_type": "code",
281-
"execution_count": 10,
195+
"execution_count": null,
282196
"id": "75ecdd19-bd9a-4d93-bb18-a6216e3fde1b",
283197
"metadata": {
284198
"tags": []
285199
},
286200
"outputs": [],
287201
"source": [
288-
"grid_plot[\"top-right-plot\"][\"rand-img\"].cmap.vmin = 0.5"
202+
"grid_plot[\"top-right\"][\"rand-img\"].cmap.vmin = 0.5"
289203
]
290204
},
291205
{
292206
"cell_type": "code",
293-
"execution_count": 11,
207+
"execution_count": null,
294208
"id": "4f5f7fab-d7f2-4b6b-8f2d-c0745f9193cb",
295209
"metadata": {
296210
"tags": []
297211
},
298212
"outputs": [],
299213
"source": [
214+
"grid_plot.close()\n",
300215
"sc.close()"
301216
]
302217
},

0 commit comments

Comments
 (0)