print logo

Configuring SciTools

SciTools comes with many default choices of plotting program (backend) and many other adjustable parameters. These settings are defined in a configuration file .scitools.cfg You can download such a .scitools.cfg file and place it in your home folder (do not change the filename - it has to be exactly .scitools.cfg with the initial dot!). SciTools cannot plot - it needs another program like Gnuplot and Matplotlib to do that, but it provides a unified interface such that you can easily switch between the plotting programs (called backends). If you have problems with using Gnuplot, you might want to switch permanently to Matplotlib (recall to have a raw_input() at the end of the program to ensure the plot stays on the screen). The particular .scitools.cfg file shown below sets Matplotlib as the default plotting program in the line right below [easyviz]. You can also control the behavior of Matplotlib or Gnuplot through many other options that are listed in the configuration file.

; Default configuration file scitools.cfg
; Items in this default file can be overridden by
;   .scitools.cfg in the directory where the Python program is started
;   .scitools.cfg in the user's home directory

; Some variables in this file can also be overridden by environment
; variables. The name of the environment variable is
; prefix_section_option, where section and option are the section and
; option names as given below and prefix is set below.
; Examples: SCITOOLS_globals_VERBOSE, SCITOOLS_easyviz_backend

; Enable setting variables by environment variables with
; prefix_variablename, e.g., SCITOOLS_globals_DEBUG
envir prefix = SCITOOLS

; Enable reading from command line through --variablename option,
; e.g., --SCITOOLS_globals_DEBUG
; (such command-line options and values are removed from sys.argv
; after being read such that the rest of the code is not affected)
command line arguments = on

SAFECODE     =  on    ; boolean: safety checks or not
OPTIMIZATION =   off   ; 'F77', 'C', 'vectorization', 'on', etc.
VERBOSE      =   0     ; an int for the level of verbosity in output
DEBUG        =   0     ; debug level (0=off)
; python -O implies that DEBUG is set to 0

;load =  yes           ; yes: from scipy import * (may have side effects)
load =  no         ; yes: from scipy import * (may have side effects)

numpytools =  no   ; no: load numpy and numpyutils, yes: load numpytools

; Configuration of SciPy/NumPy: see documentation of scitools.basics

backend     = matplotlib ; default backend for plotting
;backend    = gnuplot    ; another popular default backend for plotting
; backends are gnuplot, matplotlib, matlab, veusz, grace, dx, pyx, vtk
show        =  yes  ; screenplot after each plot command
interactive =  yes  ; update backend after each change
color       =  no   ; hardcopy with color?
linestyleorder =  ['-'] ; line styles for plots with multiple lines
colororder  =  ['b','g','r','c','m','y','k'] ; same for colors
clevels     =  8     ; default number of contour levels in a contour plot
hold        =  off  ; hold or clear plot between plotting commands
grid        =  off  ; turn grid on or off by default
box         =  off  ; box around boundaries of the axes
hidden      =  on   ; use hidden line removal on meshes
colormap    =  None ; default colormap
fontsize    =  12    ; font size used in titles, labels, ...
fontname    =  Helvetica  ; font used for titles, labels, ...
fgcolor     =  (0,0,0)   ; foreground color (titles, labels, axes, ...)
bgcolor     =  (1,1,1)   ; axis background color
cblocation  =  EastOutside  ; default location for a color bar
size        =  [None,None] ; default figure size

; See in the source for details about the meaning
; of these options.
;gnuplot_command            =  gnuplot
;recognizes_persist         =  None
prefer_persist             =  1
;recognizes_binary_splot    =  1
;prefer_inline_data         =  0
;support_fifo               =  1
;prefer_fifo_data           =  1
;default_term               =  x11
;default_term               =  wxt   ; wxWidgets
;default_lpr                =  | lpr
;prefer_enhanced_postscript =  1

; Override values from the matplotlib configuration file
backend     = TkAgg  ; default backend
; other backends are ps, Qt4Agg, GTK, GTKAgg, svg, agg, cairo, MacOSX, GTKCairo, WXAgg, TkAgg, QtAgg, FltkAgg, pdf, CocoaAgg, emf, gdk, template, WX
;font.size   =  10
;axes.labelsize =  10
;text.fontsize =  10
;xtick.labelsize =  8
;ytick.labelsize =  8
text.usetex =  false  ; use LaTeX or not

Publisert Sat, 21 Dec 2013 22:54:27 +0100