Fill space between two lines
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | y | ||
real(kind=wp), | intent(in), | dimension(:) | :: | x1 | ||
real(kind=wp), | intent(in), | optional | dimension(:) | :: | x0 | |
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.
subroutine fillBetweenx(y,x1,x0,fillColor,fillPattern,lineWidth)
!! Fill space between two lines
real(wp),dimension(:),intent(in)::y
real(wp),dimension(:),intent(in)::x1
real(wp),dimension(:),intent(in),optional::x0
character(*),intent(in),optional::fillColor
character(*),intent(in),optional::fillPattern
real(wp),intent(in),optional::lineWidth
real(pp),dimension(:),allocatable::yl,x1l,x0l
integer::N
N = size(y)
yl = localize(y)
x1l = localize(x1)
if(present(x0)) then
x0l = localize(x0)
else
allocate(x0l(N))
x0l = 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([x1l(1:N:1),x0l(N:1:-1)],[yl(1:N:1),yl(N:1:-1)])
call resetPen()
end subroutine fillBetweenx