6 module function fpd_get_axes_cmd(this) result(x)
8 class(filled_plot_data),
intent(in) :: this
9 character(len = :),
allocatable :: x
12 if (this%get_draw_against_y2())
then
20 pure module function fpd_get_draw_against_y2(this) result(x)
21 class(filled_plot_data),
intent(in) :: this
27 module subroutine fpd_set_draw_against_y2(this, x)
28 class(filled_plot_data),
intent(inout) :: this
29 logical,
intent(in) :: x
34 module function fpd_get_cmd(this) result(x)
36 class(filled_plot_data),
intent(in) :: this
37 character(len = :),
allocatable :: x
40 type(string_builder) :: str
48 n = len_trim(this%get_name())
50 call str%append(
' "-" title "')
51 call str%append(this%get_name())
54 call str%append(
' "-" notitle')
58 call str%append(
" with filledcurves")
61 clr = this%get_line_color()
62 call str%append(
' lc rgb "#')
63 call str%append(clr%to_hex_string())
68 call str%append(this%get_axes_string())
71 x = char(str%to_string())
75 module function fpd_get_data_cmd(this) result(x)
77 class(filled_plot_data),
intent(in) :: this
78 character(len = :),
allocatable :: x
81 type(string_builder) :: str
83 character(len = :),
allocatable :: nl, delimiter
91 do i = 1,
size(this%m_data, 1)
92 call str%append(to_string(this%m_data(i,1)))
93 call str%append(delimiter)
94 call str%append(to_string(this%m_data(i,2)))
95 call str%append(delimiter)
96 call str%append(to_string(this%m_data(i,3)))
101 x = char(str%to_string())
105 module subroutine fpd_define_data(this, x, y, yc, err)
107 class(filled_plot_data),
intent(inout) :: this
108 real(real64),
intent(in),
dimension(:) :: x, y, yc
109 class(errors),
intent(inout),
optional,
target :: err
112 type(errors),
target :: deferr
113 class(errors),
pointer :: errmgr
114 character(len = 256) :: errmsg
115 integer(int32) :: i, n, flag
118 if (
present(err))
then
126 if (
size(y) /= n)
then
127 write(errmsg, 100)
"Expected the y array to have ", n, &
128 " elements, but found an array with ",
size(y),
" elements."
129 call errmgr%report_error(
"fpd_define_data", trim(errmsg), &
130 plot_array_size_mismatch_error)
133 if (
size(yc) /= n)
then
134 write(errmsg, 100)
"Expected the yc array to have ", n, &
135 " elements, but found an array with ",
size(yc),
" elements."
136 call errmgr%report_error(
"fpd_define_data", trim(errmsg), &
137 plot_array_size_mismatch_error)
142 if (
allocated(this%m_data))
deallocate(this%m_data)
143 allocate(this%m_data(n, 3), stat = flag)
145 call errmgr%report_error(
"fpd_define_data", &
146 "Insufficient memory available.", &
147 plot_out_of_memory_error)
152 do concurrent(i = 1:n)
153 this%m_data(i,1) = x(i)
154 this%m_data(i,2) = y(i)
155 this%m_data(i,3) = yc(i)
158100
format(a, i0, a, i0, a)