Setup PlPlot library, optionally overriding defaults
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in), | optional | :: | device | Output device to use
|
|
character(len=*), | intent(in), | optional | :: | fileName | Name of file(s) to write to The text |
|
real(kind=wp), | intent(in), | optional | :: | fontScaling | Font scaling relative to default value |
|
logical, | intent(in), | optional | :: | whiteOnBlack | Default foreground and background colors |
|
logical, | intent(in), | optional | :: | transparent | Transparent background |
|
character(len=*), | intent(in), | optional | :: | colormap | Colormap to use |
|
integer, | intent(in), | optional | dimension(2) | :: | figSize | Size of figures to produce in pixels |
subroutine setup(device,fileName,fontScaling,whiteOnBlack,transparent,colormap,figSize)
!! Setup PlPlot library, optionally overriding defaults
character(*),intent(in),optional::device
!! Output device to use
!!
!! * qtwidget
!! * svgqt
!! * pngqt
character(*),intent(in),optional::fileName
!! Name of file(s) to write to
!!
!! The text `%n` will be replaced with the figure number
real(wp),intent(in),optional::fontScaling
!! Font scaling relative to default value
logical,intent(in),optional::whiteOnBlack
!! Default foreground and background colors
logical,intent(in),optional::transparent
!! Transparent background
character(*),intent(in),optional::colormap
!! Colormap to use
integer,dimension(2),intent(in),optional::figSize
!! Size of figures to produce in pixels
character(64)::bufx,bufy
if(present(device)) then
call plsdev(device)
else
call plsdev(default_dev)
end if
call plsfam(1,1,100)
if(present(fileName)) then
call plsfnam(fileName)
else
call plsfnam('out')
end if
if(present(whiteOnBlack)) blackOnWhite = .not. whiteOnBlack
if(present(transparent)) transparentBackground = transparent
call setIndexedColors()
if(present(colormap)) then
call setColormap(colormap)
else
call setColormap('CoolWarm')
end if
call plfontld(0)
if(present(fontScaling)) fontScale = real(fontScaling,pp)
if(present(figSize)) then
write(bufx,*) figSize(1)
write(bufy,*) figSize(2)
call plsetopt('geometry',trim(adjustl(bufx))//'x'//trim(adjustl(bufy)))
else
call plsetopt('geometry','640x480')
end if
call plinit()
call resetPen()
end subroutine setup