axes Module

Tick labels, axis titles and colorbars.

Called from draw_scene (draw.f90); holds no state.



Variables

Type Visibility Attributes Name Initial
real(kind=real64), private, parameter :: CB_TICK = 0.8d0

Colorbar tick label height, as a multiple of chs.

real(kind=real64), private, parameter :: CB_TITLE = 3.5d0

Colorbar title offset from the strip, in tick label heights.


Interfaces

interface

  • public function c_giza_round(x, nsub) result(r) bind(C, name='giza_round'))

    Round x to a nice tick step.

    Smallest of 2, 5 or 10 times a power of ten not below |x|, w/ sign of x. Binds giza's C giza_round directly.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=c_double), value :: x

    Value to round.

    integer(kind=c_int), intent(out) :: nsub

    Minor tick intervals per step: 2 for a step of 2, else 5.

    Return Value real(kind=c_double)


Functions

public pure function is_reversed(name)

Test whether colormap name ends in reversing suffix '_r'.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Colormap name.

Return Value logical


Subroutines

public subroutine fit_x_step(wx1, wx2, wy1, wy2, xlim, step, nsub)

Choose tick step of linear x axis.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: wx1

Left window edge, in world coords.

real(kind=real64), intent(in) :: wx2

Right window edge, in world coords.

real(kind=real64), intent(in) :: wy1

Bottom window edge, in world coords.

real(kind=real64), intent(in) :: wy2

Top window edge, in world coords.

real(kind=real64), intent(in) :: xlim

Right limit of x labels, as fraction of page width.

real(kind=real64), intent(out) :: step

Tick step, in world coords.

integer(kind=c_int), intent(out) :: nsub

Minor tick intervals per step.

public subroutine tick_labels(wx1, wx2, wy1, wy2, xstep, ystep, xlim, dry, crowded)

Write tick labels of giza_box option 'N', minus any that would clip.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: wx1

Left window edge, in world coords.

real(kind=real64), intent(in) :: wx2

Right window edge, in world coords.

real(kind=real64), intent(in) :: wy1

Bottom window edge, in world coords.

real(kind=real64), intent(in) :: wy2

Top window edge, in world coords.

real(kind=real64), intent(in) :: xstep

x tick step, unused on log axis.

real(kind=real64), intent(in) :: ystep

y tick step, unused on log axis.

real(kind=real64), intent(in) :: xlim

Right limit of x labels, as fraction of page width.

logical, intent(in) :: dry

Only test x labels for crowding, writing nothing.

logical, intent(out) :: crowded

An x label was dropped for sitting too close to previous one.

public subroutine labels(xlabel, ylabel)

Build axis titles from axis quantities and units.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(out) :: xlabel

x-axis title.

character(len=*), intent(out) :: ylabel

y-axis title.

public subroutine draw_colorbar(layer)

Draw energy-layer colorbar in right margin.

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: layer

Energy layer, numbered as in layers.f90.

private subroutine colorbar_viewport()

Set viewport of colorbar strip in right margin.

Read more…

Arguments

None

private subroutine cell_label(y, txt)

Write horizontal label beside colorbar strip.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: y

Height in strip window, 0 to 1.

character(len=*), intent(in) :: txt

Label text.

private subroutine colorbar_title(y, fjust, h, txt)

Write text up outer side of colorbar.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: y

Position along strip, as fraction of its height.

real(kind=real64), intent(in) :: fjust

Justification about y: 0 starts the text there, 1 ends it there, 0.5 centres it.

real(kind=real64), intent(in) :: h

Character height, as multiple of chs.

character(len=*), intent(in) :: txt

Text to write.

public subroutine draw_field_colorbar(f)

Draw colour-field colorbar in right margin.

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: f

Colour field index, as registered in convdata.f90.

public pure subroutine colormap(t, r, g, b)

Return colour of colormap st%cmap at t.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: t

Position in colormap, 0 to 1.

real(kind=real64), intent(out) :: r

Red component, 0 to 1.

real(kind=real64), intent(out) :: g

Green component, 0 to 1.

real(kind=real64), intent(out) :: b

Blue component, 0 to 1.