contour Subroutine

public subroutine contour(x, y, z, N, lineColor, lineStyle, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-coordinates of data

real(kind=wp), intent(in), dimension(:):: y

y-coordinates of data

real(kind=wp), intent(in), dimension(:,:):: z

Data for contouring

integer, intent(in), optional :: N

Number of levels to use in contour

character(len=*), intent(in), optional :: lineColor

Color of contour lines

character(len=*), intent(in), optional :: lineStyle

Style of contour lines

real(kind=wp) , optional :: lineWidth

Width of contour lines

Description

Plot contour lines

Calls

proc~~contour~~CallsGraph proc~contour contour plcont plcont proc~contour->plcont
Help

Called By

proc~~contour~~CalledByGraph proc~contour contour proc~docontour doContour proc~docontour->proc~contour program~examples_prg examples_prg program~examples_prg->proc~docontour
Help

Variables

TypeVisibility AttributesNameInitial
real(kind=pp), public, dimension(:), allocatable:: xl
real(kind=pp), public, dimension(:), allocatable:: yl
real(kind=pp), public, dimension(:,:), allocatable:: zl
real(kind=pp), public, dimension(:), allocatable:: edge
integer, public :: Nl
integer, public :: k

Source Code

	subroutine contour(x,y,z,N,lineColor,lineStyle,lineWidth)
		!! Plot contour lines
		real(wp),dimension(:),intent(in)::x
			!! x-coordinates of data
		real(wp),dimension(:),intent(in)::y
			!! y-coordinates of data
		real(wp),dimension(:,:),intent(in)::z
			!! Data for contouring
		integer,intent(in),optional::N
			!! Number of levels to use in contour
		character(*),intent(in),optional::lineColor
			!! Color of contour lines
		character(*),intent(in),optional::lineStyle
			!! Style of contour lines
		real(wp),optional::lineWidth
			!! Width of contour lines
		
		real(pp),dimension(:),allocatable::xl,yl
		real(pp),dimension(:,:),allocatable::zl
		
		real(pp),dimension(:),allocatable::edge
		integer::Nl,k
		
		xl = localize(x)
		yl = localize(y)
		zl = localize(z)
		Nl = 20
		if(present(N)) Nl = N
		edge = [( real(k-1,pp)/real(Nl-1,pp)*(maxval(zl)-minval(zl))+minval(zl) ,k=1,Nl)]
		
		if(present(lineColor)) call setColor(lineColor)
		if(present(lineStyle)) call setLineStyle(lineStyle)
		if(present(lineWidth)) call setLineWidth(lineWidth)
		
		call plcont(zl,edge,xl,yl)
		call resetPen()
	end subroutine contour