Plot a 3d surface
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 surface colors |
|
character(len=*), | intent(in), | optional | :: | lineStyle | Style for xy lines ( '-' = on, '' = off ) |
subroutine surface(x,y,z,N,lineStyle)
!! Plot a 3d surface
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 surface colors
character(*),intent(in),optional::lineStyle
!! Style for xy lines ( '-' = on, '' = off )
real(pp),dimension(:),allocatable::xl,yl
real(pp),dimension(:,:),allocatable::zl
real(pp),dimension(:),allocatable::edge
integer::Nl,opt
opt = MAG_COLOR
xl = localize(x)
yl = localize(y)
zl = localize(z)
Nl = 20
if(present(N)) then
Nl = N
opt = ior(opt,SURF_CONT)
end if
edge = localize(linspace(minval(z),maxval(z),Nl))
if(present(lineStyle)) then
select case(lineStyle)
case('')
opt = opt
case('-')
opt = ior(opt,FACETED)
end select
end if
call plsurf3d(xl,yl,zl,opt,edge)
call resetPen()
end subroutine surface