6 pure module function leg_get_inside(this) result(x)
7 class(legend),
intent(in) :: this
13 module subroutine leg_set_inside(this, x)
14 class(legend),
intent(inout) :: this
15 logical,
intent(in) :: x
20 pure module function leg_get_box(this) result(x)
21 class(legend),
intent(in) :: this
27 module subroutine leg_set_box(this, x)
28 class(legend),
intent(inout) :: this
29 logical,
intent(in) :: x
34 module function leg_get_horz_pos(this) result(x)
35 class(legend),
intent(in) :: this
36 character(len = :),
allocatable :: x
38 n = len_trim(this%m_horzPosition)
39 allocate(
character(len = n) :: x)
40 x = trim(this%m_horzPosition)
44 module subroutine leg_set_horz_pos(this, x)
45 class(legend),
intent(inout) :: this
46 character(len = *),
intent(in) :: x
47 this%m_horzPosition = x
48 if (x /= legend_left .and. x /= legend_right .and. x /= legend_center) &
49 this%m_horzPosition = legend_right
53 module function leg_get_vert_pos(this) result(x)
54 class(legend),
intent(in) :: this
55 character(len = :),
allocatable :: x
57 n = len_trim(this%m_vertPosition)
58 allocate(
character(len = n) :: x)
59 x = trim(this%m_vertPosition)
63 module subroutine leg_set_vert_pos(this, x)
64 class(legend),
intent(inout) :: this
65 character(len = *),
intent(in) :: x
66 this%m_vertPosition = x
67 if (x /= legend_top .and. x /= legend_center .and. x /= legend_bottom) &
68 this%m_vertPosition = legend_top
72 pure module function leg_get_visible(this) result(x)
73 class(legend),
intent(in) :: this
79 module subroutine leg_set_visible(this, x)
80 class(legend),
intent(inout) :: this
81 logical,
intent(in) :: x
86 module function leg_get_command_txt(this) result(txt)
88 class(legend),
intent(in) :: this
89 character(len = :),
allocatable :: txt
92 type(string_builder) :: str
98 if (.not.this%get_is_visible())
then
104 if (this%get_draw_inside_axes())
then
105 call str%append(
"set key inside")
107 call str%append(
"set key outside")
110 call str%append(this%get_vertical_position())
112 call str%append(this%get_horizontal_position())
115 call str%append(new_line(
'a'))
116 if (this%get_draw_border())
then
118 call str%append(
"set key box")
120 call str%append(
"set key nobox")
124 call str%append(new_line(
'a'))
125 call str%append(
"set key ")
126 call str%append(this%get_layout())
129 call str%append(new_line(
'a'))
130 call str%append(
"set key ")
131 if (this%get_is_opaque())
then
132 call str%append(
"opaque")
134 call str%append(
"noopaque")
138 txt = char(str%to_string())
142 pure module function leg_get_layout(this) result(rst)
143 class(legend),
intent(in) :: this
144 character(len = :),
allocatable :: rst
145 rst = trim(this%m_layout)
149 module subroutine leg_set_layout(this, x)
150 class(legend),
intent(inout) :: this
151 character(len = *),
intent(in) :: x
152 if (x == legend_arrange_horizontally .or. &
153 x == legend_arrange_vertically) &
160 pure module function leg_get_opaque(this) result(rst)
161 class(legend),
intent(in) :: this
167 module subroutine leg_set_opaque(this, x)
168 class(legend),
intent(inout) :: this