Single Responsibility: Legend layout and rendering coordination
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(legend_entry_t), | public, | allocatable | :: | entries(:) | |||
integer, | public | :: | position | = | LEGEND_UPPER_RIGHT | ||
integer, | public | :: | num_entries | = | 0 | ||
real(kind=wp), | public | :: | x_offset | = | 10.0_wp | ||
real(kind=wp), | public | :: | y_offset | = | 10.0_wp | ||
real(kind=wp), | public | :: | entry_height | = | 20.0_wp | ||
real(kind=wp), | public | :: | line_length | = | 30.0_wp | ||
real(kind=wp), | public | :: | text_padding | = | 10.0_wp |
Add entry following Open/Closed principle
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(legend_t), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | label | |||
real(kind=wp), | intent(in), | dimension(3) | :: | color | ||
character(len=*), | intent(in), | optional | :: | linestyle | ||
character(len=*), | intent(in), | optional | :: | marker |
Render legend following Liskov Substitution Works with any backend that implements plot_context interface
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(legend_t), | intent(in) | :: | this | |||
class(plot_context), | intent(inout) | :: | backend |
Set legend position using string interface
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(legend_t), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | location |
Clear all legend entries
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(legend_t), | intent(inout) | :: | this |