Plotting 1d Simulation¶
Pydro provides plotting routines for plotting snapshots at a single time, as well as for plotting spacetime diagrams of quantities.
-
Plotting.
generate_plot_with_reference
(x, x_ref, func, reference_solution, quantity_name, file_name, ref_label, every_n=0, set_log_y=False)¶ Generate a plot of a snapshot from a 1d simulation and write it to disk.
- Parameters
x (list) – The x-coordinates on which func is defined.
x_ref (list) – The x-coordinates on which reference_solution is defined.
func (list) – The function/variable to plot.
reference_solution (list) – The reference solution to plot.
quantity_name (str) – The label for the function/variable being plotted.
file_name (str) – The name of the file to write.
ref_label (str) – The reference label. Typically either ‘Exact’ or ‘Reference’ depending on whether the reference solution is an exact analytic solution or obtained from a high-resolution simulation.
every_n (int) – If non-zero only plot every nth grid point in func.
set_log_y (bool) – If True then the y-axis is plotted on a log scale.
-
Plotting.
generate_spacetime_plot
(file_name, var, var_name, x, times, smoothen, set_log_y, vmin=None, vmax=None, time_max_elements=100, x_max_elements=200)¶ Generate a spacetime plot from a 1d simulation and write it to disk.
- Parameters
file_name (str) – The name of the file to write.
var (list) – A list of the variable/function to plot at each time. The data must be in the same order as the times argument.
var_name (str) – The name of the variable being plotted.
x (list) – The x-coordinates on which var is defined. Assumed to be time-independent.
times (list) – A list of the times at which data was recorded during the evolution.
smoothen (bool) – If True applies a gouraud smoothening to the data during rendering.
set_log_y (bool) – If True then the log of var is plotted.
vmin (double) – If specified sets the lower limit of the range for plotting var.
vmax (double) – If specified sets the upper limit of the range for plotting var.
time_max_elements (int) – The maximum number of cells to plot in time. Increasing this increases the temporal resolution but makes the generated images larger and more expensive to render.
x_max_elements (int) – The maximum number of cells to plot in space. Increasing this increases the temporal resolution but makes the generated images larger and more expensive to render.