6 module function pa_get_title(this) result(txt)
7 class(plot_axis),
intent(in) :: this
8 character(len = :),
allocatable :: txt
10 n = len_trim(this%m_title)
11 allocate(
character(len = n) :: txt)
12 txt = trim(this%m_title)
16 module subroutine pa_set_title(this, txt)
18 class(plot_axis),
intent(inout) :: this
19 character(len = *),
intent(in) :: txt
25 n = min(len_trim(txt), plotdata_max_name_length)
28 this%m_title(1:n) = txt(1:n)
29 this%m_hasTitle = .true.
31 this%m_hasTitle = .false.
36 pure module function pa_has_title(this) result(x)
37 class(plot_axis),
intent(in) :: this
43 pure module function pa_get_autoscale(this) result(x)
44 class(plot_axis),
intent(in) :: this
50 module subroutine pa_set_autoscale(this, x)
51 class(plot_axis),
intent(inout) :: this
52 logical,
intent(in) :: x
57 pure module function pa_get_axis_limits(this) result(x)
58 class(plot_axis),
intent(in) :: this
59 real(real64),
dimension(2) :: x
60 x(1) = minval(this%m_limits)
61 x(2) = maxval(this%m_limits)
65 module subroutine pa_set_axis_limits(this, lower, upper)
66 class(plot_axis),
intent(inout) :: this
67 real(real64),
intent(in) :: lower, upper
68 this%m_limits(1) = lower
69 this%m_limits(2) = upper
73 pure module function pa_get_log_scale(this) result(x)
74 class(plot_axis),
intent(in) :: this
80 module subroutine pa_set_log_scale(this, x)
81 class(plot_axis),
intent(inout) :: this
82 logical,
intent(in) :: x
87 module function pa_get_cmd_string(this) result(txt)
89 class(plot_axis),
intent(in) :: this
90 character(len = :),
allocatable :: txt
93 type(string_builder) :: str
94 character(len = :),
allocatable :: axis, fmt
95 real(real64) :: lim(2)
98 axis = this%get_id_string()
99 fmt = this%get_tic_label_format()
100 lim = this%get_limits()
101 call str%initialize()
104 if (.not.this%get_use_default_tic_label_format())
then
105 call str%append(
"set format ")
106 call str%append(axis)
110 call str%append(new_line(
'a'))
114 if (this%get_autoscale())
then
115 call str%append(
"set ")
116 call str%append(axis)
117 call str%append(
"range [*:*]")
119 call str%append(
"set ")
120 call str%append(axis)
121 call str%append(
"range [")
122 call str%append(to_string(lim(1)))
124 call str%append(to_string(lim(2)))
129 call str%append(new_line(
'a'))
130 if (this%is_title_defined())
then
131 call str%append(
"set ")
132 call str%append(axis)
133 call str%append(
"label ")
135 call str%append(this%get_title())
138 call str%append(
"set ")
139 call str%append(axis)
140 call str%append(
"label ")
141 call str%append(
'""')
145 call str%append(new_line(
'a'))
146 if (this%get_is_log_scaled())
then
147 call str%append(
"set log ")
148 call str%append(axis)
150 call str%append(
"unset log ")
151 call str%append(axis)
155 if (this%get_zero_axis())
then
156 call str%append(new_line(
'a'))
157 call str%append(
"set ")
158 call str%append(this%get_id_string())
159 call str%append(
"zeroaxis linestyle -1 linewidth ")
160 call str%append(to_string(this%get_zero_axis_line_width()))
164 txt = char(str%to_string())
168 pure module function pa_get_zero_axis(this) result(x)
169 class(plot_axis),
intent(in) :: this
175 module subroutine pa_set_zero_axis(this, x)
176 class(plot_axis),
intent(inout) :: this
177 logical,
intent(in) :: x
182 pure module function pa_get_zero_axis_width(this) result(x)
183 class(plot_axis),
intent(in) :: this
189 module subroutine pa_set_zero_axis_width(this, x)
190 class(plot_axis),
intent(inout) :: this
191 real(real32),
intent(in) :: x
197 pure module function pa_get_use_dft_tic_lbl_fmt(this) result(rst)
198 class(plot_axis),
intent(in) :: this
200 rst = this%m_defaultTicLabels
204 module subroutine pa_set_use_dft_tic_lbl_fmt(this, x)
205 class(plot_axis),
intent(inout) :: this
206 logical,
intent(in) :: x
207 this%m_defaultTicLabels = x
211 pure module function pa_get_tic_label_fmt(this) result(rst)
212 class(plot_axis),
intent(in) :: this
213 character(len = :),
allocatable :: rst
214 rst = trim(this%m_ticLabelFmt)
218 module subroutine pa_set_tic_label_fmt(this, x)
219 class(plot_axis),
intent(inout) :: this
220 character(len = *),
intent(in) :: x
221 this%m_ticLabelFmt = x