Fill space between two lines
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
real(kind=wp), | intent(in), | dimension(:) | :: | y1 | ||
real(kind=wp), | intent(in), | optional | dimension(:) | :: | y0 | |
character(len=*), | intent(in), | optional | :: | fillColor | ||
character(len=*), | intent(in), | optional | :: | fillPattern | ||
real(kind=wp), | intent(in), | optional | :: | lineWidth |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
subroutine fillBetween(x,y1,y0,fillColor,fillPattern,lineWidth)
!! Fill space between two lines
real(wp),dimension(:),intent(in)::x
real(wp),dimension(:),intent(in)::y1
real(wp),dimension(:),intent(in),optional::y0
character(*),intent(in),optional::fillColor
character(*),intent(in),optional::fillPattern
real(wp),intent(in),optional::lineWidth
real(pp),dimension(:),allocatable::xl,y1l,y0l
integer::N
N = size(x)
xl = localize(x)
y1l = localize(y1)
if(present(y0)) then
y0l = localize(y0)
else
allocate(y0l(N))
y0l = 0.0_pp
end if
if(present(fillColor)) call setColor(fillColor)
if(present(fillPattern)) call setFillPattern(fillPattern)
if(present(lineWidth)) call setLineWidth(lineWidth)
call plfill([xl(1:N:1),xl(N:1:-1)],[y1l(1:N:1),y0l(N:1:-1)])
call resetPen()
end subroutine fillBetween