Skip to content

Commit

Permalink
[#177] Added single cube slice plot (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraydenThompson authored Apr 19, 2024
1 parent 3ae5d25 commit 3329438
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 37 deletions.
44 changes: 8 additions & 36 deletions GoVizzy/GoVizzy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,22 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "c31b2aca",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "53607c596d444a7e970ddd843418c366",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"AppLayout(children=(HBox(children=(Output(layout=Layout(height='100%', width='70%')), VBox(children=(HBox(chil…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e07b178719f64af8ba8a442d37d4201e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(Text(value='', description='File Name:'), Button(description='Submit', style=ButtonStyle())), l…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"%matplotlib widget\n",
"%run Main.py\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c75f164c-2d9f-44b9-8875-82d7f34a7d4e",
"metadata": {
"scrolled": true
},
"id": "04d9e89a-528c-4cf9-97a0-687f4ff969be",
"metadata": {},
"outputs": [],
"source": []
}
Expand Down
10 changes: 10 additions & 0 deletions GoVizzy/gv_ui/gv_ui/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ipyvolume as ipv
from IPython.display import display
from gv_ui import gvWidgets
import matplotlib.pyplot as plt

class Visualizer:
"""
Expand Down Expand Up @@ -127,3 +128,12 @@ def display_cell_slices(self):

ipv.show()

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

fig, ax = plt.subplots()

def update(w = 70):
ax.imshow(cube.data3D[w])
plt.show()

widgets.interact(update, w=widgets.IntSlider(min=0, max=119, step=1, value=70))
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ipympl==0.9.3
ase==3.22.1
ipython_genutils==0.2.0
ipywidgets==8.1.2
ipyvolume==0.6.3
jupyter==1.0.0
jupyterlab_widgets==3.0.10
pytest==8.1.0
pytest==8.1.0

0 comments on commit 3329438

Please sign in to comment.