-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplot.py
More file actions
26 lines (19 loc) · 742 Bytes
/
plot.py
File metadata and controls
26 lines (19 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
try:
import numpy as np
import matplotlib.pyplot as plotting
except ImportError as error_message:
print(error_message)
exit(0)
def plotter(stress_points, positions, diagram):
''' It is simple SFD and BMD plotter.
:param stress_points - Stress at a position along the bar.
:param positions - Position along the bar where a breakpoint occurs.
:param diagram - The type of diagram(SFD or BMD).
'''
plotting.figure(diagram + ' diagram')
plotting.title(diagram + ' diagram')
plotting.xlabel('Position along length of the member ->')
plotting.ylabel(diagram + ' ->')
plotting.scatter(positions, stress_points)
plotting.plot(positions, stress_points)
plotting.show()