scatter Subroutine

public subroutine scatter(x, y, c, s, markColor, markStyle, markSize)

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), 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

Description

Create scatter plot of data

Calls

proc~~scatter~~CallsGraph proc~scatter scatter interface~mixval mixval proc~scatter->interface~mixval plcol1 plcol1 proc~scatter->plcol1 plptex plptex proc~scatter->plptex plschr plschr proc~scatter->plschr plssym plssym proc~scatter->plssym
Help

Called By

proc~~scatter~~CalledByGraph proc~scatter scatter proc~doscatter doScatter proc~doscatter->proc~scatter program~examples_prg examples_prg program~examples_prg->proc~doscatter
Help

Variables

TypeVisibility AttributesNameInitial
real(kind=pp), public, dimension(:), allocatable:: xl
real(kind=pp), public, dimension(:), allocatable:: yl
real(kind=pp), public, dimension(:), allocatable:: cb
character(len=32), public :: code
integer, public :: k

Source Code

	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