fplot 1.7.1
A Fortran library providing a convenient interface for plotting with Gnuplot.
Loading...
Searching...
No Matches
fplot_plot_bar.f90
1! fplot_plot_bar.f90
2
3submodule(fplot_core) fplot_plot_bar
4contains
5! ------------------------------------------------------------------------------
6pure module function pb_get_bar_width(this) result(x)
7 class(plot_bar), intent(in) :: this
8 real(real32) :: x
9 x = this%m_barWidth
10end function
11
12! ------------------------------------------------------------------------------
13module subroutine pb_set_bar_width(this, x)
14 class(plot_bar), intent(inout) :: this
15 real(real32), intent(in) :: x
16 if (x > 1.0) then
17 this%m_barWidth = 1.0
18 else if (x < 0.0) then
19 this%m_barWidth = 0.0
20 else
21 this%m_barWidth = x
22 end if
23end subroutine
24
25! ------------------------------------------------------------------------------
26module function pb_get_cmd(this) result(x)
27 ! Arguments
28 class(plot_bar), intent(in) :: this
29 character(len = :), allocatable :: x
30
31 ! Local Variables
32 type(string_builder) :: str
33
34 ! Initialization
35 call str%initialize()
36
37 ! Box Width
38 call str%append(new_line('a'))
39 call str%append("set boxwidth ")
40 call str%append(to_string(this%get_bar_width()))
41 call str%append(" relative")
42
43 ! Call the base routine to establish the remainder of the plot
44 call str%append(this%plot_2d%get_command_string())
45
46 ! End
47 x = char(str%to_string())
48end function
49
50! ------------------------------------------------------------------------------
51! TO DO YET:
52! - clustering
53! - stacking
54! - lighting
55end submodule
fplot_core