- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(import 'matplotlib.pyplot as plt)
(import 'numpy as np)
(def elevation_points (list (list 0 100) (list 5 150) (list 10 100) (list 15 120) (list 20 80)))
(def section_points (list (list 0 50) (list 5 75) (list 10 50) (list 15 60) (list 20 40)))
(plt.figure (figsize (list 10 5)))
(plt.plot (apply 'zip (apply 'list elevation_points)) :marker "o" :linestyle "-" :color "b")
(plt.title "Elevation Profile")
(plt.xlabel "Distance (m)")
(plt.ylabel "Elevation (m)")
(plt.savefig "elevation_plot.png")
(plt.show)
(plt.figure (figsize (list 10 5)))
(plt.plot (apply 'zip (apply 'list section_points)) :marker "o" :linestyle "-" :color "r")
(plt.title "Section Profile")
(plt.xlabel "Distance (m)")
(plt.ylabel "Elevation (m)")
(plt.savefig "section_plot.png")
(plt.show))
Solved! Go to Solution.