PDF axes, grid, and tick drawing operations Handles plot frame, axes, tick marks, and grid lines
Set up data ranges for axes with optional log scaling
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| real(kind=wp), | intent(in) | :: | x_min_orig | |||
| real(kind=wp), | intent(in) | :: | x_max_orig | |||
| real(kind=wp), | intent(in) | :: | y_min_orig | |||
| real(kind=wp), | intent(in) | :: | y_max_orig | |||
| real(kind=wp), | intent(out) | :: | x_min_adj | |||
| real(kind=wp), | intent(out) | :: | x_max_adj | |||
| real(kind=wp), | intent(out) | :: | y_min_adj | |||
| real(kind=wp), | intent(out) | :: | y_max_adj | |||
| character(len=*), | intent(in), | optional | :: | xscale | ||
| character(len=*), | intent(in), | optional | :: | yscale |
Generate tick positions and labels for axes Refactored to be under 100 lines (QADS compliance)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(in) | :: | ctx | |||
| real(kind=wp), | intent(in) | :: | data_x_min | |||
| real(kind=wp), | intent(in) | :: | data_x_max | |||
| real(kind=wp), | intent(in) | :: | data_y_min | |||
| real(kind=wp), | intent(in) | :: | data_y_max | |||
| real(kind=wp), | intent(out), | allocatable | :: | x_positions(:) | ||
| real(kind=wp), | intent(out), | allocatable | :: | y_positions(:) | ||
| character(len=50), | intent(out), | allocatable | :: | x_labels(:) | ||
| character(len=50), | intent(out), | allocatable | :: | y_labels(:) | ||
| integer, | intent(out) | :: | num_x_ticks | |||
| integer, | intent(out) | :: | num_y_ticks | |||
| character(len=*), | intent(in), | optional | :: | xscale | ||
| character(len=*), | intent(in), | optional | :: | yscale | ||
| character(len=*), | intent(in), | optional | :: | x_date_format | ||
| character(len=*), | intent(in), | optional | :: | y_date_format | ||
| real(kind=wp), | intent(in) | :: | plot_area_left | |||
| real(kind=wp), | intent(in) | :: | plot_area_bottom | |||
| real(kind=wp), | intent(in) | :: | plot_area_width | |||
| real(kind=wp), | intent(in) | :: | plot_area_height | |||
| real(kind=wp), | intent(in), | optional | :: | symlog_threshold |
Draw complete axes system with labels using actual plot area coordinates
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| character(len=*), | intent(in), | optional | :: | xscale | ||
| character(len=*), | intent(in), | optional | :: | yscale | ||
| real(kind=wp), | intent(in), | optional | :: | symlog_threshold | ||
| real(kind=wp), | intent(in) | :: | data_x_min | |||
| real(kind=wp), | intent(in) | :: | data_x_max | |||
| real(kind=wp), | intent(in) | :: | data_y_min | |||
| real(kind=wp), | intent(in) | :: | data_y_max | |||
| character(len=*), | intent(in), | optional | :: | title | ||
| character(len=*), | intent(in), | optional | :: | xlabel | ||
| character(len=*), | intent(in), | optional | :: | ylabel | ||
| character(len=*), | intent(in), | optional | :: | x_date_format | ||
| character(len=*), | intent(in), | optional | :: | y_date_format | ||
| real(kind=wp), | intent(in) | :: | plot_area_left | |||
| real(kind=wp), | intent(in) | :: | plot_area_bottom | |||
| real(kind=wp), | intent(in) | :: | plot_area_width | |||
| real(kind=wp), | intent(in) | :: | plot_area_height |
Draw the plot frame using actual plot area coordinates (FIXED version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| real(kind=wp), | intent(in) | :: | plot_left | |||
| real(kind=wp), | intent(in) | :: | plot_bottom | |||
| real(kind=wp), | intent(in) | :: | plot_width | |||
| real(kind=wp), | intent(in) | :: | plot_height |
Draw tick marks using actual plot area coordinates (FIXED version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| real(kind=wp), | intent(in) | :: | x_positions(:) | |||
| real(kind=wp), | intent(in) | :: | y_positions(:) | |||
| integer, | intent(in) | :: | num_x | |||
| integer, | intent(in) | :: | num_y | |||
| real(kind=wp), | intent(in) | :: | plot_left | |||
| real(kind=wp), | intent(in) | :: | plot_bottom |
Draw tick labels using actual plot area coordinates (FIXED version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| real(kind=wp), | intent(in) | :: | x_positions(:) | |||
| real(kind=wp), | intent(in) | :: | y_positions(:) | |||
| character(len=*), | intent(in) | :: | x_labels(:) | |||
| character(len=*), | intent(in) | :: | y_labels(:) | |||
| integer, | intent(in) | :: | num_x | |||
| integer, | intent(in) | :: | num_y | |||
| real(kind=wp), | intent(in) | :: | plot_left | |||
| real(kind=wp), | intent(in) | :: | plot_bottom | |||
| real(kind=wp), | intent(in) | :: | plot_height | |||
| real(kind=wp), | intent(out), | optional | :: | max_y_tick_label_width |
Draw plot title and axis labels
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| character(len=*), | intent(in), | optional | :: | title | ||
| character(len=*), | intent(in), | optional | :: | xlabel | ||
| character(len=*), | intent(in), | optional | :: | ylabel | ||
| real(kind=wp), | intent(in) | :: | plot_area_left | |||
| real(kind=wp), | intent(in) | :: | plot_area_bottom | |||
| real(kind=wp), | intent(in) | :: | plot_area_width | |||
| real(kind=wp), | intent(in) | :: | plot_area_height | |||
| real(kind=wp), | intent(in), | optional | :: | y_tick_label_max_width |
PDF needs Unicode superscripts converted to mathtext for proper rendering
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| real(kind=wp), | intent(in) | :: | x | |||
| real(kind=wp), | intent(in) | :: | y | |||
| character(len=*), | intent(in) | :: | text | |||
| real(kind=wp), | intent(in), | optional | :: | font_size |
Draw minor tick marks (shorter than major ticks)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(pdf_context_core), | intent(inout) | :: | ctx | |||
| real(kind=wp), | intent(in) | :: | x_minor_positions(:) | |||
| real(kind=wp), | intent(in) | :: | y_minor_positions(:) | |||
| integer, | intent(in) | :: | num_x_minor | |||
| integer, | intent(in) | :: | num_y_minor | |||
| real(kind=wp), | intent(in) | :: | plot_left | |||
| real(kind=wp), | intent(in) | :: | plot_bottom |