fillBetween Subroutine

public subroutine fillBetween(x, y1, y0, fillColor, fillPattern, lineWidth)

Arguments

Type IntentOptional AttributesName
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

Description

Fill space between two lines

Calls

proc~~fillbetween~~CallsGraph proc~fillbetween fillBetween plfill plfill proc~fillbetween->plfill
Help

Called By

proc~~fillbetween~~CalledByGraph proc~fillbetween fillBetween proc~dofillbetween doFillBetween proc~dofillbetween->proc~fillbetween program~examples_prg examples_prg program~examples_prg->proc~dofillbetween
Help

Variables

TypeVisibility AttributesNameInitial
real(kind=pp), public, dimension(:), allocatable:: xl
real(kind=pp), public, dimension(:), allocatable:: y1l
real(kind=pp), public, dimension(:), allocatable:: y0l
integer, public :: N

Source Code

	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