Skip to content

Commit

Permalink
Merge branch 'main' into 183-re-expose-opacity-and-color-sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
dignojrteogalbo committed Apr 21, 2024
2 parents 5e61bb2 + ce1ed51 commit 9da9571
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
12 changes: 2 additions & 10 deletions GoVizzy/GoVizzy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,9 @@
},
"outputs": [],
"source": [
"%matplotlib widget\n",
"%run Main.py\n"
"%run Main.py\n",
"%matplotlib widget\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "04d9e89a-528c-4cf9-97a0-687f4ff969be",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
13 changes: 9 additions & 4 deletions GoVizzy/gv_ui/gv_ui/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,15 @@ def display_cell_slices(self):

plt.style.use('_mpl-gallery-nogrid')

fig, ax = plt.subplots()
fig, (xSlice, ySlice, zSlice) = plt.subplots(1, 3)

def update(w = 70):
ax.imshow(cube.data3D[w])
# Slice order is different to match ipyvolume, which plots the volume in a y-up orientation
def update(x = 0, y = 0, z = 0):
xSlice.imshow(cube.data3D[:, :, x])
ySlice.imshow(cube.data3D[:, y, :])
zSlice.imshow(cube.data3D[z, :, :])
plt.show()

widgets.interact(update, w=widgets.IntSlider(min=0, max=119, step=1, value=70))
widgets.interact(update, x=widgets.IntSlider(min=0, max=119, step=1, value=0),
y=widgets.IntSlider(min=0, max=119, step=1, value=0),
z=widgets.IntSlider(min=0, max=119, step=1, value=0))

0 comments on commit 9da9571

Please sign in to comment.