Core plot data structures - extracted from fortplot_figure_core
This module contains only data structure definitions following the Single Responsibility Principle. Contains plot_data_t, arrow_data_t, and subplot_t type definitions.
SOLID: Single responsibility for data modeling only
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | PLOT_TYPE_LINE | = | 1 | |
integer, | public, | parameter | :: | PLOT_TYPE_CONTOUR | = | 2 | |
integer, | public, | parameter | :: | PLOT_TYPE_PCOLORMESH | = | 3 | |
integer, | public, | parameter | :: | PLOT_TYPE_ERRORBAR | = | 4 | |
integer, | public, | parameter | :: | PLOT_TYPE_BAR | = | 5 | |
integer, | public, | parameter | :: | PLOT_TYPE_HISTOGRAM | = | 6 | |
integer, | public, | parameter | :: | PLOT_TYPE_BOXPLOT | = | 7 | |
integer, | public, | parameter | :: | PLOT_TYPE_SCATTER | = | 8 | |
real(kind=wp), | public, | parameter | :: | HALF_WIDTH | = | 0.5_wp | |
real(kind=wp), | public, | parameter | :: | IQR_WHISKER_MULTIPLIER | = | 1.5_wp |
Data container for streamplot arrows Stores position, direction, size and style for arrow rendering
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | x | = | 0.0_wp | ||
real(kind=wp), | public | :: | y | = | 0.0_wp | ||
real(kind=wp), | public | :: | dx | = | 0.0_wp | ||
real(kind=wp), | public | :: | dy | = | 0.0_wp | ||
real(kind=wp), | public | :: | size | = | 1.0_wp | ||
character(len=10), | public | :: | style | = | '->' |
Data container for individual plots Separated from figure to follow Single Responsibility Principle
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | plot_type | = | PLOT_TYPE_LINE | ||
real(kind=wp), | public, | allocatable | :: | x(:) | |||
real(kind=wp), | public, | allocatable | :: | y(:) | |||
real(kind=wp), | public, | allocatable | :: | z(:) | |||
real(kind=wp), | public, | allocatable | :: | x_grid(:) | |||
real(kind=wp), | public, | allocatable | :: | y_grid(:) | |||
real(kind=wp), | public, | allocatable | :: | z_grid(:,:) | |||
real(kind=wp), | public, | allocatable | :: | contour_levels(:) | |||
logical, | public | :: | use_color_levels | = | .false. | ||
character(len=20), | public | :: | colormap | = | 'crest' | ||
logical, | public | :: | show_colorbar | = | .true. | ||
type(pcolormesh_t), | public | :: | pcolormesh_data | ||||
real(kind=wp), | public, | allocatable | :: | bar_x(:) | |||
real(kind=wp), | public, | allocatable | :: | bar_heights(:) | |||
real(kind=wp), | public | :: | bar_width | = | 0.8_wp | ||
logical, | public | :: | bar_horizontal | = | .false. | ||
real(kind=wp), | public, | allocatable | :: | hist_bin_edges(:) | |||
real(kind=wp), | public, | allocatable | :: | hist_counts(:) | |||
logical, | public | :: | hist_density | = | .false. | ||
real(kind=wp), | public, | allocatable | :: | box_data(:) | |||
real(kind=wp), | public | :: | position | = | 1.0_wp | ||
real(kind=wp), | public | :: | width | = | 0.6_wp | ||
logical, | public | :: | show_outliers | = | .true. | ||
logical, | public | :: | horizontal | = | .false. | ||
real(kind=wp), | public | :: | q1 | ||||
real(kind=wp), | public | :: | q2 | ||||
real(kind=wp), | public | :: | q3 | ||||
real(kind=wp), | public | :: | whisker_low | ||||
real(kind=wp), | public | :: | whisker_high | ||||
real(kind=wp), | public, | allocatable | :: | outliers(:) | |||
real(kind=wp), | public, | allocatable | :: | xerr(:) | |||
real(kind=wp), | public, | allocatable | :: | yerr(:) | |||
real(kind=wp), | public, | allocatable | :: | xerr_lower(:) | |||
real(kind=wp), | public, | allocatable | :: | xerr_upper(:) | |||
real(kind=wp), | public, | allocatable | :: | yerr_lower(:) | |||
real(kind=wp), | public, | allocatable | :: | yerr_upper(:) | |||
real(kind=wp), | public | :: | capsize | = | 5.0_wp | ||
real(kind=wp), | public | :: | elinewidth | = | 1.0_wp | ||
logical, | public | :: | has_xerr | = | .false. | ||
logical, | public | :: | has_yerr | = | .false. | ||
logical, | public | :: | asymmetric_xerr | = | .false. | ||
logical, | public | :: | asymmetric_yerr | = | .false. | ||
real(kind=wp), | public, | allocatable | :: | scatter_sizes(:) | |||
real(kind=wp), | public, | allocatable | :: | scatter_colors(:) | |||
real(kind=wp), | public | :: | scatter_size_default | = | 20.0_wp | ||
character(len=20), | public | :: | scatter_colormap | = | 'viridis' | ||
logical, | public | :: | scatter_colorbar | = | .false. | ||
real(kind=wp), | public | :: | scatter_vmin | = | 0.0_wp | ||
real(kind=wp), | public | :: | scatter_vmax | = | 1.0_wp | ||
logical, | public | :: | scatter_vrange_set | = | .false. | ||
real(kind=wp), | public, | dimension(3) | :: | color | = | [0.0_wp, 0.447_wp, 0.698_wp] | |
character(len=:), | public, | allocatable | :: | label | |||
character(len=:), | public, | allocatable | :: | linestyle | |||
character(len=:), | public, | allocatable | :: | marker |
procedure, public :: is_3d |
Individual subplot container
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(plot_data_t), | public, | allocatable | :: | plots(:) | |||
integer, | public | :: | plot_count | = | 0 | ||
integer, | public | :: | max_plots | = | 10 | ||
character(len=:), | public, | allocatable | :: | title | |||
character(len=:), | public, | allocatable | :: | xlabel | |||
character(len=:), | public, | allocatable | :: | ylabel | |||
character(len=10), | public | :: | xscale | = | 'linear' | ||
character(len=10), | public | :: | yscale | = | 'linear' |
Subplot data container (extracted from fortplot_figure_core)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(plot_data_t), | public, | allocatable | :: | plots(:) | |||
integer, | public | :: | plot_count | = | 0 | ||
character(len=:), | public, | allocatable | :: | title | |||
character(len=:), | public, | allocatable | :: | xlabel | |||
character(len=:), | public, | allocatable | :: | ylabel | |||
real(kind=wp), | public | :: | x_min | ||||
real(kind=wp), | public | :: | x_max | ||||
real(kind=wp), | public | :: | y_min | ||||
real(kind=wp), | public | :: | y_max | ||||
logical, | public | :: | xlim_set | = | .false. | ||
logical, | public | :: | ylim_set | = | .false. | ||
integer, | public | :: | max_plots | = | 100 |