Skip to content
Snippets Groups Projects
Commit f220783a authored by Djalim Simaila's avatar Djalim Simaila
Browse files

added visplot and matplotlib cross section

parent 533077d8
No related branches found
No related tags found
1 merge request!7added visplot and matplotlib cross section
......@@ -8,4 +8,14 @@ def render2D(values:list):
fig = plt.figure()
ax = fig.add_subplot()
ax.plot(values)
plt.show()
def cross_section(x:list,y:list):
"""
Render a 2D model using matplotlib
:param values: A list with the values
"""
fig = plt.figure()
ax = fig.add_subplot()
ax.scatter(x,y)
plt.show()
\ No newline at end of file
import vispy.plot as vp
import numpy as np
def render2D(values:list):
fig = vp.Fig(size=(600, 500), show=False)
plotwidget = fig[0, 0]
fig.title = "bollu"
plotwidget.plot(values)
plotwidget.colorbar(position="top", cmap="autumn")
fig.show(run=True)
def cross_section(x:list,y:list):
color = (0.3, 0.5, 0.8)
fig = vp.Fig(show=False)
line = fig[0:4, 0:4].plot(np.column_stack((x,y)), symbol='o', width=0,
face_color=color + (0.02,), edge_color=None,
marker_size=8)
line.set_gl_state(depth_test=False)
fig.show(run=True)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment