Spectral Integral Suite in C++
plotlyPlots.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 # %%
4 import numpy
5 import meshio
6 mesh = meshio.read('../data/Ex11vec_noscale0385.vtk')
7 #print(vars(mesh))
8 points = mesh.points
9 #print(points)
10 pressure = mesh.point_data['pressure']
11 #pressure
12 velocity = mesh.point_data['Velocity']
13 #print(velocity[:,0])
14 #velocity
15 
16 import plotly.io as pio
17 pio.renderers.default = "iframe"
18 import plotly.graph_objects as go
19 fig= go.Figure(data=go.Isosurface(
20  x= points[:,0],
21  z=points[:,1],
22  y=points[:,2],
23  colorscale=[[1,'rgb(0,255,0)'],[1,'rgb(255,0,0)']],
24  showscale=False,
25  lighting=dict(specular=0.5,ambient=0.8),
26  value=velocity[:,0],
27  isomin=-0.006,
28  isomax=0.006,
29  caps=dict(x_show=False, y_show=False,z_show=False)
30 ))
31 
32 fig.update_layout(
33  title = dict(text="Isosurfaces of the most amplified streamwise velocity fluctuations", font = dict(family="CMU Serif", size=24,color="#000")),
34  scene=dict(
35  # annotations=dict(
36  # x = 0,
37  # y = 0,
38  # z = 0,
39  # text="<i>y</i>"),
40  camera=dict(
41  eye=dict(x=1.25,y= 1,z = 1.25),
42  projection=dict(type="orthographic")),
43  xaxis = dict(
44  tickangle=0,
45  title=dict(
46  text ="<i>x</i>",
47  font=dict(
48  family="CMU Serif",
49  size = 20,color="#000"
50  )),
51 
52  tickfont = dict(family="CMU Serif",size = 12,color="#000")),
53  yaxis = dict(
54  tickangle=0,
55  title=dict(
56  text ="<i>z</i>",
57  font=dict(
58  family="CMU Serif",
59  size = 20,color="#000"
60  )),
61  tickfont = dict(family="CMU Serif",size = 12,color="#000")),
62  zaxis = dict(
63  tickangle=0,
64  title=dict(
65  text ="<i>y</i>",
66  font=dict(
67  family="CMU Serif",
68  size = 20,color="#000"
69  )),
70  tickfont = dict(family='"CMU Serif", "Times New Roman",Arial ',size = 12,color="#000"))
71 ))
72 fig.show()
73 
74 
75 # %%
76 
77 # %%