ipnm in Jupyter notebooks

Picture a nice description line here.


In [1]:
%load_ext autoreload
%autoreload 2

In [2]:
import sys
sys.path.append('../')
import ipnm

In [11]:
ipnm.plot('data/cube.json')



In [12]:
ipnm.plot('data/cube.json', default_pore_color=False)



In [13]:
ipnm.plot('data/cube.json', default_throat_color=False)



In [5]:
import json
from IPython.display import display, HTML

with open('data/cube.json', 'r') as f:
    cube = json.load(f)

shaders = ("basic", "lambert", "phong")
renders = [ipnm.plot(cube, size=(400, 200), shader=s, z=2, display_html=False) for s in shaders]
columns = ('<div class="col-xs-6 col-sm-3">{}</div>'.format(r) for r in renders)
display(HTML('<div class="row">{}</div>'.format("".join(columns))))



In [7]:
help(ipnm.plot)


Help on function plot in module ipnm.notebook_display:

plot(data, size=(600, 400), z=2, bounding_box=True, default_pore_color=6013150, default_throat_color=11184810, default_color_scale='rainbow', pore_width_segments=8, pore_height_segments=6, throat_radius_segments=8, throat_height_segments=1, shader='basic', antialias=True, display_html=True)


In [23]:
pnm = ipnm.format_converter.read_openpnm('data/net.vtp')

In [24]:
ipnm.plot(pnm)



In [ ]: