topoviz.py¶
TopoViz
¶
flowchart TD
erosionfront.visualization.topoviz.TopoViz[TopoViz]
erosionfront.visualization.base.GraphingBase[GraphingBase]
erosionfront.visualization.base.GraphingBase --> erosionfront.visualization.topoviz.TopoViz
click erosionfront.visualization.topoviz.TopoViz href "" "erosionfront.visualization.topoviz.TopoViz"
click erosionfront.visualization.base.GraphingBase href "" "erosionfront.visualization.base.GraphingBase"
Visualization of 3D topo data.
Methods:
-
create_figure–Initialize a :mod:
Pyplot <matplotlib.pyplot>figure. -
get_aspect–Get aspect ratio of graph.
-
get_fonts–Fetch the names of all the font families available on the system.
-
naturalize–Adjust graph aspect ratio into 'natural' ratio.
-
plot_3d–Display (possibly) interactive 3D view using PyVista
-
plot_profiles–X
-
plot_slopes–X
-
stretch–Stretch graph axes by respective factors.
Source code in erosionfront/visualization/base.py
create_figure
¶
create_figure(
fig_name: str, fig_size: tuple[float, float] | None = None, dpi: int | None = None
) -> Figure
Initialize a :mod:Pyplot <matplotlib.pyplot> figure.
Set its size and dpi, set the font size, choose the Arial font family if possible, and append it to the figures dictionary.
Parameters¶
fig_name: name of figure; used as key in figures dictionary fig_size: optional width and height of figure in inches dpi: rasterization resolution
Returns¶
:obj:Pyplot figure <matplotlib.figure.Figure>:
reference to :mod:MatPlotLib/Pyplot <matplotlib.pyplot>
figure
Source code in erosionfront/visualization/base.py
get_aspect
¶
get_aspect(axes: Axes) -> float
Get aspect ratio of graph.
Parameters¶
axes:
the axes object of the figure
Returns¶
float: aspect ratio
Source code in erosionfront/visualization/base.py
get_fonts
¶
Fetch the names of all the font families available on the system.
Source code in erosionfront/visualization/base.py
naturalize
¶
Adjust graph aspect ratio into 'natural' ratio.
Source code in erosionfront/visualization/base.py
plot_3d
¶
Display (possibly) interactive 3D view using PyVista
Parameters¶
mesh: MultiBlock X geometry: Geometry X profiles: Profiles X
Returns¶
Plotter: An instance of a PyVista 3D viewer.
Source code in erosionfront/visualization/topoviz.py
plot_profiles
¶
plot_profiles(
fig_name: str,
profiles: Profiles,
choices: tuple[str, ...] | None,
marker_size: float | None,
line_width: float | None,
xlim: tuple[float, float] | None = None,
ylim: tuple[float, float] | None = None,
scale: float = 1,
do_equal: bool = True,
do_normals: bool = False,
vector_sf: float = 1,
θ_clip: tuple[float, float] = (0, 90),
title_font_size: int = 12,
fig_size: tuple[float, float] = (7, 5),
) -> None
X
Parameters¶
fig_name: str Name used as key in figure dictionary. profiles: dict[Any: Profile] X choices: tuple[str,...] | None X marker_size: float | None X line_width: float | None X xlim: tuple[float,float] | None = None X ylim: tuple[float,float] | None = None X scale: float=1 X do_equal: bool=True X
use_normals: bool=False¶
X
do_normals: bool=False X vector_sf: float=1 X
do_flip_orientation: bool=False¶
X
θ_clip: tuple[float,float]=(0,90,) X title_font_size: int=12 Size of title text. fig_size: tuple[float, float]=(7, 5,) Figure size (in inches!).
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/topoviz.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
plot_slopes
¶
plot_slopes(
fig_name: str,
profiles: Profiles,
choices: tuple[str, ...] | None,
w_filter: int = 15,
scale: float = 1,
line_width: float = 1,
do_points: bool = False,
title_font_size: int = 12,
fig_size: tuple[float, float] = (6, 3.5),
) -> None
X
Parameters¶
fig_name: str Name used as key in figure dictionary. profiles: Profiles X choices: tuple[str,...] | None X w_filter: int=15 X scale: float=1 X line_width: float=1 X do_points: bool=False X title_font_size: int=12 Size of title text. fig_size: tuple[float, float]=(7, 5,) Figure size (in inches!).
Attributes¶
Uses create_figure (adds to fig dict).
Source code in erosionfront/visualization/topoviz.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | |
stretch
¶
stretch(
fig: Figure,
xs: tuple[float, float] | None = None,
ys: tuple[float, float] | None = None,
) -> None
Stretch graph axes by respective factors.