plot_data_function Derived Type

type, public, extends(line_plot_data) :: plot_data_function

Defines a function to plot.


Contents


Type-Bound Procedures

procedure, public :: clear_all => pd_clear

  • private subroutine pd_clear(this)

    Clears the data set by removing stored data and clearing the GNUPLOT datablock name. This routine also calls clear_data to ensure the data is cleared from the data set as well as the datablock name.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data), intent(inout) :: this

    The plot_data object.

procedure, public :: clear_data => pdf_clear_data

  • private subroutine pdf_clear_data(this)

    Clears the function from this data set.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(inout) :: this

    The plot_data_function object.

procedure, public :: create_unique_datablock_name => pd_create_unique_datablock_name

  • private subroutine pd_create_unique_datablock_name(this)

    Creates a unique name for the GNUPLOT datablock representing this data set.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data), intent(inout) :: this

    The plot_data object.

procedure, public :: define_data => pdf_define_data

  • private subroutine pdf_define_data(this, f, fname, minX, maxX, name)

    Defines the function to plot.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(inout) :: this

    The plot_data_function object.

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

    The function to plot (e.g. sin(x)).

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

    The name of the function to plot (e.g. f(x)).

    real(kind=real64), intent(in), optional :: minX

    The minimum value to plot. If not supplied, this will default to a value of -1.

    real(kind=real64), intent(in), optional :: maxX

    The maximum x value to plot. If not supplied, this will default to a value of 1.

    character(len=*), intent(in), optional :: name

    An optional input that specifies the name that will be displayed in the legend. If nothing is supplied, the input string for parameter f will be utilized.

procedure, public :: get_color_index => pdc_get_color_index

  • private pure function pdc_get_color_index(this) result(x)

    Gets the color index.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_colored), intent(in) :: this

    The plot_data_colored object.

    Return Value integer(kind=int32)

    The index value.

procedure, public :: get_command_string => pdf_get_cmd

  • private function pdf_get_cmd(this) result(rst)

    Gets the GNUPLOT command string for this object.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(in) :: this

    The plot_data_function object.

    Return Value character(len=:), allocatable

    The command string.

procedure, public :: get_data_string => pdf_get_data_cmd

  • private function pdf_get_data_cmd(this) result(rst)

    Gets the GNUPLOT command string defining the data for this object.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(in) :: this

    The plot_data_function object.

    Return Value character(len=:), allocatable

    The command string.

procedure, public :: get_datablock_name => pd_get_datablock_name

  • private pure function pd_get_datablock_name(this) result(rst)

    Gets the name to associate with the datablock in the actual GNUPLOT plot file.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data), intent(in) :: this

    The plot_data object.

    Return Value character(len=:), allocatable

    The name.

procedure, public :: get_draw_line => lpd_get_draw_line

  • private pure function lpd_get_draw_line(this) result(x)

    Gets a value determining if a line should be drawn.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(in) :: this

    The line_plot_data object.

    Return Value logical

    Returns true if the line should be drawn; else, false.

procedure, public :: get_draw_markers => lpd_get_draw_markers

  • private pure function lpd_get_draw_markers(this) result(x)

    Gets a value determining if data point markers should be drawn.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(in) :: this

    The line_plot_data object.

    Return Value logical

    Returns true if the markers should be drawn; else, false.

procedure, public :: get_function => pdf_get_function

  • private pure function pdf_get_function(this) result(rst)

    Gets the function to plot.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(in) :: this

    The plot_data_function object.

    Return Value character(len=:), allocatable

    The function.

procedure, public :: get_function_name => pdf_get_function_name

  • private pure function pdf_get_function_name(this) result(rst)

    Gets the name of the function to plot (e.g. f(x), g(x), etc.).

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(in) :: this

    The plot_data_function object.

    Return Value character(len=:), allocatable

    The function name.

procedure, public :: get_line_color => pdc_get_line_color

  • private pure function pdc_get_line_color(this) result(x)

    Gets the object color.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_colored), intent(in) :: this

    The plot_data_colored object.

    Return Value type(color)

    The color.

procedure, public :: get_line_style => lpd_get_line_style

  • private pure function lpd_get_line_style(this) result(x)

    Gets the line style.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(in) :: this

    The line_plot_data object.

    Return Value integer(kind=int32)

    The line style. The line style must be one of the following.

    • LINE_DASHED

    • LINE_DASH_DOTTED

    • LINE_DASH_DOT_DOT

    • LINE_DOTTED

    • LINE_SOLID

procedure, public :: get_line_width => lpd_get_line_width

  • private pure function lpd_get_line_width(this) result(x)

    Gets the width of the line, in pixels.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(in) :: this

    The line_plot_data object.

    Return Value real(kind=real32)

    The line width.

procedure, public :: get_marker_frequency => lpd_get_marker_frequency

  • private pure function lpd_get_marker_frequency(this) result(x)

    Gets the marker frequency.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(in) :: this

    The line_plot_data object.

    Return Value integer(kind=int32)

    The marker frequency.

procedure, public :: get_marker_scaling => lpd_get_marker_scaling

  • private pure function lpd_get_marker_scaling(this) result(x)

    Gets the marker scaling.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(in) :: this

    The line_plot_data object.

    Return Value real(kind=real32)

    The scaling factor.

procedure, public :: get_marker_style => lpd_get_marker_style

  • private pure function lpd_get_marker_style(this) result(x)

    Gets the marker style.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(in) :: this

    The line_plot_data object.

    Return Value integer(kind=int32)

    The marker type. The marker type must be one of the following:

    • MARKER_ASTERISK

    • MARKER_EMPTY_CIRCLE

    • MARKER_EMPTY_NABLA

    • MARKER_EMPTY_RHOMBUS

    • MARKER_EMPTY_SQUARE

    • MARKER_EMPTY_TRIANGLE

    • MARKER_FILLED_CIRCLE

    • MARKER_FILLED_NABLA

    • MARKER_FILLED_RHOMBUS

    • MARKER_FILLED_SQUARE

    • MARKER_FILLED_TRIANGLE

    • MARKER_PLUS

    • MARKER_X

procedure, public :: get_maximum_x => pdf_get_max_x

  • private pure function pdf_get_max_x(this) result(rst)

    Gets the maximum X plot range value.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(in) :: this

    The plot_data_function object.

    Return Value real(kind=real64)

    The value.

procedure, public :: get_minimum_x => pdf_get_min_x

  • private pure function pdf_get_min_x(this) result(rst)

    Gets the minimum X plot range value.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(in) :: this

    The plot_data_function object.

    Return Value real(kind=real64)

    The value.

procedure, public :: get_name => pd_get_name

  • private pure function pd_get_name(this) result(txt)

    Gets the name to associate with this data set.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data), intent(in) :: this

    The plot_data object.

    Return Value character(len=:), allocatable

    The name.

procedure, public :: get_sample_count => pfd_get_sample_count

  • private pure function pfd_get_sample_count(this) result(rst)

    Gets the number of times to sample the function.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(in) :: this

    The plot_data_function object.

    Return Value integer(kind=int32)

    The sample count.

procedure, public :: set_color_index => pdc_set_color_index

  • private subroutine pdc_set_color_index(this, x)

    Sets the color index.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_colored), intent(inout) :: this

    The plot_data_colored object.

    integer(kind=int32), intent(in) :: x

    The index value.

procedure, public :: set_datablock_name => pd_set_datablock_name

  • private subroutine pd_set_datablock_name(this, x)

    Sets the name to associate with the datablock in the actual GNUPLOT plot file.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data), intent(inout) :: this

    The plot_data object.

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

    The name.

procedure, public :: set_draw_line => lpd_set_draw_line

  • private subroutine lpd_set_draw_line(this, x)

    Sets a value determining if a line should be drawn.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(inout) :: this

    The line_plot_data object.

    logical, intent(in) :: x

    Set to true if the line should be drawn; else, false.

procedure, public :: set_draw_markers => lpd_set_draw_markers

  • private subroutine lpd_set_draw_markers(this, x)

    Sets a value determining if data point markers should be drawn.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(inout) :: this

    The line_plot_data object.

    logical, intent(in) :: x

    Set to true if the markers should be drawn; else, false.

procedure, public :: set_line_color => pdc_set_line_color

  • private subroutine pdc_set_line_color(this, x)

    Sets the object color.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_colored), intent(inout) :: this

    The plot_data_colored object.

    type(color), intent(in) :: x

    The color.

procedure, public :: set_line_style => lpd_set_line_style

  • private subroutine lpd_set_line_style(this, x)

    Sets the line style.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(inout) :: this

    The line_plot_data object.

    integer(kind=int32), intent(in) :: x

    The line style. The line style must be one of the following.

    • LINE_DASHED

    • LINE_DASH_DOTTED

    • LINE_DASH_DOT_DOT

    • LINE_DOTTED

    • LINE_SOLID

procedure, public :: set_line_width => lpd_set_line_width

  • private subroutine lpd_set_line_width(this, x)

    Sets the width of the line, in pixels.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(inout) :: this

    The line_plot_data object.

    real(kind=real32), intent(in) :: x

    The line width.

procedure, public :: set_marker_frequency => lpd_set_marker_frequency

  • private subroutine lpd_set_marker_frequency(this, x)

    Sets the marker frequency.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(inout) :: this

    The line_plot_data object.

    integer(kind=int32), intent(in) :: x

    The marker frequency.

procedure, public :: set_marker_scaling => lpd_set_marker_scaling

  • private subroutine lpd_set_marker_scaling(this, x)

    Sets the marker scaling.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(inout) :: this

    The line_plot_data object.

    real(kind=real32), intent(in) :: x

    The scaling factor.

procedure, public :: set_marker_style => lpd_set_marker_style

  • private subroutine lpd_set_marker_style(this, x)

    Sets the marker style.

    Arguments

    Type IntentOptional Attributes Name
    class(line_plot_data), intent(inout) :: this

    The line_plot_data object.

    integer(kind=int32), intent(in) :: x

    The marker type. The marker type must be one of the following:

    • MARKER_ASTERISK

    • MARKER_EMPTY_CIRCLE

    • MARKER_EMPTY_NABLA

    • MARKER_EMPTY_RHOMBUS

    • MARKER_EMPTY_SQUARE

    • MARKER_EMPTY_TRIANGLE

    • MARKER_FILLED_CIRCLE

    • MARKER_FILLED_NABLA

    • MARKER_FILLED_RHOMBUS

    • MARKER_FILLED_SQUARE

    • MARKER_FILLED_TRIANGLE

    • MARKER_PLUS

    • MARKER_X

procedure, public :: set_maximum_x => pdf_set_max_x

  • private subroutine pdf_set_max_x(this, x)

    Sets the maximum X plot range value.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(inout) :: this

    The plot_data_function object.

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

    The value.

procedure, public :: set_minimum_x => pdf_set_min_x

  • private subroutine pdf_set_min_x(this, x)

    Sets the minimum X plot range value.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(inout) :: this

    The plot_data_function object.

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

    The value.

procedure, public :: set_name => pd_set_name

  • private subroutine pd_set_name(this, txt)

    Sets the name to associate with this data set.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data), intent(inout) :: this

    The plot_data object.

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

    The name.

procedure, public :: set_sample_count => pfd_set_sample_count

  • private subroutine pfd_set_sample_count(this, x)

    Sets the number of times to sample the function. This variable is global for all function plots as GNUPLOT does not allow inline sample modification currently. Hopefully this will change somewhere down the road.

    Arguments

    Type IntentOptional Attributes Name
    class(plot_data_function), intent(inout) :: this

    The plot_data_function object.

    integer(kind=int32), intent(in) :: x

    The sample count. Must be greater than 1.