Plot contour lines
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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