Skip to content

Commit 43a4025

Browse files
committed
buffer calls
added wrappers with call to buffering routines; thought this might solve the non-write of png’s. It did not.
1 parent 9337903 commit 43a4025

File tree

2 files changed

+50
-7
lines changed

2 files changed

+50
-7
lines changed

private/pg_plots.f

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ module pg_plots
55
integer, parameter :: return_size_in_px = 3
66

77
contains
8+
subroutine grid_plot(p)
9+
type(pg_data), pointer :: p
10+
11+
call pgbbuf()
12+
call pgeras()
13+
call do_grid(p,0.0,1.0,1.0,0.0,1.0)
14+
call pgebuf()
15+
end subroutine grid_plot
16+
817
subroutine do_grid(p,xleft,xright,ytop,ybottom,txt_scale)
918
use, intrinsic :: iso_fortran_env, only: error_unit
1019
type(pg_data), pointer :: p
@@ -89,6 +98,15 @@ end subroutine adjust_padding_and_set_size
8998

9099
end subroutine do_grid
91100

101+
subroutine simplt_plot(p)
102+
type(pg_data), pointer :: p
103+
104+
call pgbbuf()
105+
call pgeras()
106+
call do_simplt(p,0.0,1.0,1.0,0.0,1.0)
107+
call pgebuf()
108+
end subroutine simplt_plot
109+
92110
subroutine do_simplt(p,xleft,xright,ytop,ybottom,txt_scale)
93111
type(pg_data), pointer :: p
94112
real, intent(in) :: xleft, xright, ytop, ybottom,txt_scale
@@ -143,6 +161,15 @@ subroutine do_simplt(p,xleft,xright,ytop,ybottom,txt_scale)
143161
call pgline(100,xs,ys)
144162

145163
end subroutine do_simplt
164+
165+
subroutine box_plot(p)
166+
type(pg_data), pointer :: p
167+
168+
call pgbbuf()
169+
call pgeras()
170+
call do_box(p,0.0,1.0,1.0,0.0,1.0)
171+
call pgebuf()
172+
end subroutine box_plot
146173

147174
subroutine do_box(p,xleft,xright,ytop,ybottom,txt_scale)
148175
type(pg_data), pointer :: p
@@ -174,6 +201,15 @@ subroutine do_box(p,xleft,xright,ytop,ybottom,txt_scale)
174201
call pgbox('BC',0.0,0,'BC',0.0,0)
175202

176203
end subroutine do_box
204+
205+
subroutine lgdplt_plot(p)
206+
type(pg_data), pointer :: p
207+
208+
call pgbbuf()
209+
call pgeras()
210+
call do_lgdplt(p,0.0,1.0,1.0,0.0,1.0)
211+
call pgebuf()
212+
end subroutine lgdplt_plot
177213

178214
subroutine do_lgdplt(p,xleft,xright,ytop,ybottom,txt_scale)
179215
type(pg_data), pointer :: p
@@ -293,6 +329,15 @@ subroutine do_lgdplt(p,xleft,xright,ytop,ybottom,txt_scale)
293329
call pgsci(save_ci)
294330
end subroutine do_lgdplt
295331

332+
subroutine box_with_legend_plot(p)
333+
type(pg_data), pointer :: p
334+
335+
call pgbbuf()
336+
call pgeras()
337+
call do_box_with_legend(p,0.0,1.0,1.0,0.0,1.0)
338+
call pgebuf()
339+
end subroutine box_with_legend_plot
340+
296341
subroutine do_box_with_legend(p,xleft,xright,ytop,ybottom,txt_scale)
297342
type(pg_data), pointer :: p
298343
real, intent(in) :: xleft, xright, ytop, ybottom

public/pggrid_lib.f

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,17 @@ subroutine make_pggrid_plot(which_plot,ierr)
2626
call do_open(p, ierr)
2727
if (ierr /= 0) return
2828

29-
call print_pggrid_controls(p)
30-
3129
select case(which_plot)
3230
case('Grid_Plot')
33-
call do_grid(p,0.0,1.0,1.0,0.0,1.0)
31+
call grid_plot(p)
3432
case('Legend_Plot')
35-
call do_lgdplt(p,0.0,1.0,1.0,0.0,1.0)
33+
call lgdplt_plot(p)
3634
case('Simple_Plot')
37-
call do_simplt(p,0.0,1.0,1.0,0.0,1.0)
35+
call simplt_plot(p)
3836
case('Box')
39-
call do_box(p,0.0,1.0,1.0,0.0,1.0)
37+
call box_plot(p)
4038
case('Box_with_Legend')
41-
call do_box_with_legend(p,0.0,1.0,1.0,0.0,1.0)
39+
call box_with_legend_plot(p)
4240
case default
4341
write(error_unit,*) 'make_pggrid_plot: did not recognize plot_name'
4442
end select

0 commit comments

Comments
 (0)