Create scatter plot of data
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), | optional | dimension(:) | :: | c | Data for smooth coloring |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | s | Data for marker scaling |
character(len=*), | intent(in), | optional | :: | markColor | Color of markers; overridden by z |
|
character(len=*), | intent(in), | optional | :: | markStyle | Style of markers |
|
real(kind=wp), | intent(in), | optional | :: | markSize | Size of markers |
subroutine scatter(x,y,c,s,markColor,markStyle,markSize)
!! Create scatter plot of data
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),optional::c
!! Data for smooth coloring
real(wp),dimension(:),intent(in),optional::s
!! Data for marker scaling
character(*),intent(in),optional::markColor
!! Color of markers; overridden by z
character(*),intent(in),optional::markStyle
!! Style of markers
real(wp),intent(in),optional::markSize
!! Size of markers
real(pp),dimension(:),allocatable::xl,yl
real(pp),dimension(:),allocatable::cb
character(32)::code
integer::k
xl = localize(x)
yl = localize(y)
if(present(markColor)) call setColor(markColor)
code = getSymbolCode('')
if(present(markStyle)) code = getSymbolCode(markStyle)
if(present(markSize)) call plschr(0.0_pp,real(markSize,pp))
if(present(markSize)) call plssym(0.0_pp,real(markSize,pp))
if(present(c)) cb = real(mixval(c),pp)
do k=1,size(x)
if(present(c)) call plcol1( real( (c(k)-cb(1))/(cb(2)-cb(1)) ,pp) )
if(present(s)) call plschr(0.0_pp,real(s(k),pp))
if(present(s)) call plssym(0.0_pp,real(s(k),pp))
call plptex(xl(k),yl(k),0.0_pp,0.0_pp,0.5_pp,code)
end do
call resetPen()
end subroutine scatter