Density(Heat) scatter plot
PyOSP supports density scatter plot of swath analysis. Unlike swath profile, density scatter plot shows every elevation data on the figure, with heatmap-like coloring of the markers.
Along longitudinal direction
[1]:
import pyosp
baseline = pyosp.datasets.get_path("homo_baseline.shp") # the path to baseline shapefile
raster = pyosp.datasets.get_path("homo_mount.tif") # the path to raster file
elev = pyosp.Elev_curv(baseline, raster, width=100,
min_elev=0.01,
line_stepsize=3, cross_stepsize=None)
Processing: [#########################] 71 of 71 lineSteps
[2]:
elev.density_scatter()
[2]:
<AxesSubplot:xlabel='Distance', ylabel='Elevation'>
We can choose other colormaps, or parameters regarding Matplotlib scatter plot.
[3]:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
elev.density_scatter(ax=ax, bins=10, cmap="jet", s=10)
[3]:
<AxesSubplot:xlabel='Distance', ylabel='Elevation'>
Along cross-section
Density scatter can be also plotted for cross-swath analysis.
[4]:
fig, ax = plt.subplots()
elev.cross_plot(density_scatter=True, ax=ax, start=50, end=100, cmap="jet", s=10)