Plot 3D Heatmap#
- pybamm.plot_3d_heatmap(solution: Solution, variable: str, t: float | None, ax=None, show_plot: bool = True, cmap: str = 'inferno', marker_size: float = 10, alpha: float = 0.7, use_offset: bool = False, **kwargs)[source]#
Creates a 3D scatter plot of a variable from a PyBaMM solution with a 3D mesh.
This function visualizes the solution directly on the FEM nodes, providing a true representation of the 3D data.
- Parameters:
solution (pybamm.Solution) – The solution object containing the 3D variable.
variable (str, optional) – The name of the 3D variable to plot (default: “Cell temperature [K]”).
t (float, optional) – The time at which to plot. If None, the last timestep is used.
ax (matplotlib.axes.Axes, optional) – A 3D axes object on which to draw the plot. If None, a new figure and axes are created.
show_plot (bool, optional) – Whether to display the plot (default: True).
cmap (str, optional) – The colormap for the plot (default: ‘inferno’).
marker_size (float, optional) – The size of the markers in the scatter plot (default: 10).
alpha (float, optional) – The transparency of the markers (0=transparent, 1=opaque). Default is 0.7.
use_offset (bool, optional) – If True, uses scientific notation for the color bar (default: False).
**kwargs – Additional keyword arguments passed to matplotlib.axes.Axes.scatter.