setup Subroutine

public subroutine setup(device, fileName, fontScaling, whiteOnBlack, transparent, colormap, figSize)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in), optional :: device

Output device to use

  • qtwidget
  • svgqt
  • pngqt
character(len=*), intent(in), optional :: fileName

Name of file(s) to write to

The text %n will be replaced with the figure number

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

Description

Setup PlPlot library, optionally overriding defaults

Calls

proc~~setup~~CallsGraph proc~setup setup plfontld plfontld proc~setup->plfontld plsetopt plsetopt proc~setup->plsetopt plinit plinit proc~setup->plinit plsdev plsdev proc~setup->plsdev plsfam plsfam proc~setup->plsfam plsfnam plsfnam proc~setup->plsfnam
Help

Called By

proc~~setup~~CalledByGraph proc~setup setup program~basic_prg basic_prg program~basic_prg->proc~setup program~examples_prg examples_prg program~examples_prg->proc~setup program~animate_prg animate_prg program~animate_prg->proc~setup program~logo_prg logo_prg program~logo_prg->proc~setup
Help

Variables

TypeVisibility AttributesNameInitial
character(len=64), public :: bufx
character(len=64), public :: bufy

Source Code

	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