Profile Plots¶
ProfilePlot¶
Bases: BasePlot
Profile or cross-section plot.
Source code in src/monet_plots/plots/profile.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
__init__(*, x, y, z=None, alt_adjust=None, **kwargs)
¶
Parameters¶
x X-axis data. y Y-axis data. z Optional Z-axis data for contour plots. alt_adjust Value to subtract from the y-axis data for altitude adjustment. **kwargs Keyword arguments passed to the parent class.
Source code in src/monet_plots/plots/profile.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
plot(**kwargs)
¶
Parameters¶
**kwargs
Keyword arguments passed to matplotlib.pyplot.plot or
matplotlib.pyplot.contourf.
Source code in src/monet_plots/plots/profile.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
VerticalSlice¶
Bases: ProfilePlot
Vertical cross-section plot.
Source code in src/monet_plots/plots/profile.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
__init__(*args, **kwargs)
¶
Initialize the vertical slice plot.
Source code in src/monet_plots/plots/profile.py
68 69 70 71 72 | |
plot(**kwargs)
¶
Parameters¶
**kwargs
Keyword arguments passed to matplotlib.pyplot.contourf.
Source code in src/monet_plots/plots/profile.py
74 75 76 77 78 79 80 81 82 83 84 85 86 | |
Example¶
import numpy as np
from monet_plots.plots import VerticalSlice
# Create sample data
x = np.linspace(0, 10, 100)
y = np.linspace(0, 10, 100)
X, Y = np.meshgrid(x, y)
Z = np.sin(X) * np.cos(Y)
# Create the plot
plot = VerticalSlice(x=X, y=Y, z=Z)
plot.plot()
StickPlot¶
Bases: BasePlot
Vertical stick plot.
Source code in src/monet_plots/plots/profile.py
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 | |
__init__(u, v, y, *args, **kwargs)
¶
Initialize the stick plot. Args: u (np.ndarray, pd.Series, xr.DataArray): U-component of the vector. v (np.ndarray, pd.Series, xr.DataArray): V-component of the vector. y (np.ndarray, pd.Series, xr.DataArray): Vertical coordinate. **kwargs: Additional keyword arguments passed to BasePlot.
Source code in src/monet_plots/plots/profile.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
plot(**kwargs)
¶
Parameters¶
**kwargs
Keyword arguments passed to matplotlib.pyplot.quiver.
Source code in src/monet_plots/plots/profile.py
107 108 109 110 111 112 113 114 115 116 117 118 119 | |
Example¶
import numpy as np
from monet_plots.plots import StickPlot
# Create sample data
u = np.random.rand(10)
v = np.random.rand(10)
y = np.arange(10)
# Create the plot
plot = StickPlot(u, v, y)
plot.plot()