Reference for plot functions
BoundingBox
Synopsis
retrieves the Bounding Box of a postscript file
Usage
Double_Type (x1, y1, x2, y2) = BoundingBox(String_Type psfile);
or
Double_Type (w, h) = BoundingBox(String_Type psfile; size);
Description
x1, y1, x2, y2
are the values from the last line in psfile
of the form "%%BoundingBox: x1 y1 x2 y2"
.
x1, y1, x2, y2
are NULL
if no such line is found.
Qualifiers
- first: Take the first matching %%BoundingBox line instead of the last.
- size: If this qualifier is set,
w = x2-x1
andh = y2-y1
are returned.
array2image
Synopsis
Converts three x, y, z arrays into a 2D array
Usage
image[,] = array2image(x,y,z)
Qualifiers
- nbinx: number of bins along x-axis
- nbiny: number of bins along y-axis
- xgrid: 1D array containing grid of values for x-axis. Ignores nbinx.
- ygrid: 1D array containing grid of values for y-axis. Ignores nbiny.
- func: reference to a single-parameter S-Lang function used to determine pixel values from z-values (see below).
- func_quals: struct containing additional qualifiers to be passed to the function defined in func
- include_inf: include points where x, y, or z are inf or -inf
- include_nan: include points where x, y, or z are NaN (not a number)
Description
Rebins x, y, and z arrays to produce a 2D image suitable for plotting with plot_image(). Note that this means the returned 2D array is of the form im[y,x]. By default this ignores any points with infinite or NaN values (this can be turned off with the include_inf and include_nan switches).
The x-y grid is determined automatically from the ranges of the data, or can be defined by the "xgrid" and "ygrid" qualifiers. If "xgrid" or "ygrid" is a reference to a local variable, the automatically-determined grids will be stored in these variables. This function uses histogram2d() to bin the data and figure out which points fall into which bins, so see that function's documentation for how the grids are handled.
Notes regarding coordinate grids: * histogram2d() uses the last bin as an "overflow" bin, so user-supplied binning should have their last bin be SMALLER than the largest x- or y-value (otherwise you will have a column or a row with no points included). * The grids define the EDGES of the bins used by histogram2d(). I think (although I am not sure) that plot_image() and plot_contour() use any supplied coordinate grid to define the CENTERS of the pixels. Check the documentation of PGPLOT's PGIMAG routine to be sure. * Finally, I have no idea what histogram2d() does when it gets a pathologically-designed grid (e.g., bins with zero width, overlapping bins, or bins with lower bounds larger than their upper bounds). Please only use monotonically-increasing bins.
The value of each pixel is, by default, the average of all points which fall into that bin. This can be changed by passing a reference to a function via the "func" qualifier.
The "func" qualifier must be a reference to an S-Lang function which takes a single array as input and outputs a single value, e.g., mean(), sum(), or length(). The input to this function is an array containing all z-values that fall into the current pixel. However, this function also receives a set of qualifiers. By default, this gives @func access to the data, the coordinate grids, and the list of points in the current pixel via the following qualifiers: qualifier("x"), qualifier("y"), qualifier("z"): x, y, and z data coordinates qualifier("xgrid"), qualifier("ygrid"): x and y coordinate grids qualifier("ndx"): array of data indices in the current pixel
Extra qualifiers can be supplied via the func_quals qualifier, which should be set to a structure containing any additional qualifiers you need. This will be merged with the above set of qualifiers using struct_combine() with user-defined qualifiers taking precedence over the defaults in cases where the names are the same.
As an example, to set each pixel's value to the innner product of the
z-values and some other array of numbers (which we'll call "z2"), one could
define:
define arr2im_dotprod(zValues) {
variable z2 = qualifier("extra_array");
variable ndx = qualifier("ndx");
return inner_product(zValues,z2[ndx])[0];
}
and then after reading in or defining x, y, z, and z2 arrays, do:
variable im = array2image(x,y,z;func=&arr2im_dotprod,func_quals=struct{extra_array=z2});
By default this function removes infinite and NaN values from the x, y, and z arrays before doing anything; the include_inf and include_nan switches disable this behavior. Note that including infinite and/or NaN values will cause problems for the default grids and pixel value assignment, so include_inf and include_nan are best used with user-defined functions and grids.
This script is under development; please contact Paul Hemphill (pbh@space.mit.edu) regarding bugs or missing features (please do not report missing bugs; any bugs that are not present are missing intentionally).
See also: histogram2d, plot_image
change_plot_options
Synopsis
changes the currently used plot options
Usage
Struct_Type change_plot_options([plot_opt]; [default,] opt=value, opt2=value2, ...);
Description
The current plot options will be used as a starting point unless
an explicit argument plot_opt
is specified, which is used in this case.
These plot options are then modified by the opt
qualifiers (opt
can be
any fieldname of the structure returned by get_plot_options
, i.e.,
xmin
, xmax
, ymin
, ymax
, xlabel
, ylabel
, tlabel
, xopt
, yopt
, logx
, logy
,
color
, start_color
, x_unit
, line_style
, start_line_style
, line_width
,
frame_line_width
, point_style
, connect_points
, char_height
, point_size
,
ebar_term_length
, use_errorbars
, use_bin_density
,
ovp_xmin
, ovp_xmax
, ovp_ymin
, ovp_ymax
),
unless the qualifier default
is specified. In this latter case,
default plot options are set regardless of the starting plot options
and the other qualifiers.
The return value is the get_plot_options
structure before change_plot_options
was called. It can be used to reset the plot options after a change was applied.
Example
variable plot_options = change_plot_options(; line_style=2);
plot(lineX, lineY);
set_plot_options(plot_options);
See also: get_plot_options, set_plot_options
close_plot_ps2eps
Synopsis
closes a plot calls ps2eps
Usage
close_plot_ps2eps();
See also: close_plot, close_plot_ps2eps
contour_borders
Synopsis
Returns outer borders of a contour
Usage
Double_Type[] = contour_borders(fits);
Qualifiers
- conf_level [2]: set confidence level for which you need the borders
description This function takes as input a contour in fits-format saved with save_conf and returns the array [par1_min,par1_max,par2_min,par2_max]. Select the confidence level with the conf_level quelifier (1,2,3).
Example
contour_borders("contour.fits";);
See also: function_name2, function_name3
coordX_in_box
Synopsis
calculates a world x-coordinate from the relative x-coordinate in the plot box
Usage
Double_Type coordY_in_box(Double_Type x_rel)
Description
The left boundary of the plot box has x_rel==0
,
and the right boundary has x_rel==1
.
Logarithmic world-coordinates are properly taken into account.
Note that the xrange has to be set in advance
in order to calculate the world x-coordinate with coordX_in_box
.
See also: coordY_in_box, coords_in_box
coordY_in_box
Synopsis
calculates a world y-coordinate from the relative y-coordinate in the plot box
Usage
Double_Type coordY_in_box(Double_Type y_rel)
Description
The lower boundary of the plot box has y_rel==0
,
and the upper boundary has y_rel==1
.
Logarithmic world-coordinates are properly taken into account.
Note that the yrange has to be set in advance
in order to calculate the world y-coordinate with coordY_in_box
.
See also: coordX_in_box, coords_in_box
coords_in_box
Synopsis
calculates world coordinates from the relative coordinates in the plot box
Usage
(Double_Type x, y) = coordY_in_box(Double_Type x_rel, y_rel);
Description
Note that the x- and yrange has to be set in advance
in order to calculate the world coordinates with coords_in_box
.
See also: coordX_in_box, coordY_in_box
disk_map
Synopsis
Plots the megamaser disk using the output of Mark Reid's Bayesian disk fitting routine. The input file for this script is simply a text file containing the printout of the Bayesian program. For instance, if the Bayesian executable had the file name "fit_disk_v20*", then the Unix command
$./fit_disk_v20* > input.prt
would generate the appropriate input file for this script. This script is matched to version 20 of Mark's program. The default view on the disk is at theta=120° and phi=-130°, with the x-axis showing upwards.
This function is rewritten from the IDL program disk_map.pro from Dom Pesce in the version from July, 22, 2014.
Usage
disk_map(infile);
Qualifiers
- radius: size of the plotted disk radius, in mas, default: reference radius from file
- no_axes: flag to turn off the axes
- no_los: flag to turn off the line-of-sight bar
- no_disk: flag to turn off the wireframe disk model
- no_data: flag to turn off the data points
- no_grid: flag to turn off the grid
- no_color: flag to plot everything in greyscale
- scale: flag to scale the size of the data points by SNR
- reverse_x: flag to reverse the x-axis orientation; not used here
- side: see the maser disk along the line-of-sight in the x-y-plane
- above: see the maser disk from above in the x-z-plane
- projection: projects the maser spots in addition to the 3d view to the 2d planes
- scalen: half scale length of the axes; default 1.1*radius of the disk, axes are [-scalen,scalen]
- scalen_frac: distance from ticlabels to axes; default 1.05
- label_dist: distance from labels to axes; default 1.3*radius
- tics_length: length of the tics; default 0.2
Example
For a 2D plot from above:
isis> bla=disk_map("/userdata/data/litzinger/Radio/NGC1194/accel/disk_fitting/fit_disk_v20/jan2615/outjan2715";above); isis> bla.render("disk_map_above.pdf");
or for a 3D plot with projection:
isis> bla=disk_map("/userdata/data/litzinger/Radio/NGC1194/accel/disk_fitting/fit_disk_v20/jan2615/outjan2715";projection); isis> bla.render("disk_map.pdf");
Be careful!: If you plotted the 3d view and would like to plot in 2d again you have to restart isis, as it still would plot in 3d view. To set the labels and tics correctly first plot the disk with the default values and then change the values.
See also: xfig_3d_orbit_on_cube
draw_plot_commands
Synopsis
creates plot commands for drawing lines with the mouse
Usage
draw_plot_commands();
Qualifiers
- init [
=1
]: initializes plot window at the beginning
epatplot
Usage
epatplot(Struct_Type events);
erg2keV
Synopsis
converts energy from erg to keV
Usage
Double_Type new_value = erg2keV(Double_Type old_value)
Qualifiers
- y_fac: divide the value by 10^{y_fac}
See also: plot_unfold
err_map_gaussian
Synopsis
plots data points with their errorbars
Usage
err_map_gaussian(x, [xErr,] y, yErr);
or
err_map_gaussian(Struct_Type s);
Qualifiers
- xerr: change 3-argument-syntax to
err_map_gaussian(x, xErr, y);
- xminmax: changes the meaning of
xErr
-- andx
, ifxErr
is not a list - yminmax: changes the meaning of
yErr
-- andy
, ifyErr
is not a list - minmax: equivalent to both
x
- andyminmax
- x_pixel [=400]: number of x-axis bins of the image
- y_pixel [=400]: number of y-axis bins of the image
- i: index-array of subset of data points to be plotted
- xmin [=min(x data)]: minimal value of x-axis
- xmax [=max(x data)]: maximal value of x-axis
- ymin [=min(y data)]: minimal value of y-axis
- ymax [=max(y data)]: maximal value of y-axis
- min_xerr [=1e-10]: minimal error for x-values
- min_yerr [=1e-10]: minimal error for y-values
- xlog: switch to logarithmic x-axis
- ylog: switch to logarithmic y-axis
Description
Plots a 2D gaussian for each data point. The given errors are used as the width(1 sigma) of the Gaussian profiles. If asymmetric errors are used, the profile is the combination of two Gaussians. The volume of each profile is normalized.
In order to use asymetric errors for x and/or y,
the correspondig Err
argument has to be a list { Err1, Err2 }
.
If one of the minmax
qualifiers is used,
the corresponding Err
list contains directly minimum and maximum values.
If one of the minmax
qualifiers is used, but Err
is not a list,
the value and Err
arguments actually mean minimum and maximum values.
The actual value is infered to be the mean of minimum and maximum.
Examples
% examples with symmetrical errorbars:
plot_image( err_map_gaussian([1,2], [0.1,0.3], [1,1], [0.5,0.3];xmin=0,xmax=3,ymin=0,ymax=2) );
% examples with asymmetrical errorbars: plot_image( err_map_gaussian([1], {[0.1],[0.3]}, [1], {[0.1],[0.1]};xmin=0,xmax=2,ymin=0,ymax=2) );
See also: plot_with_err
fplot
Synopsis
plots data and residuals from the fits-files created with 'save_plot'
Usage
fplot(filename, [color, [dataset]]);
Qualifiers
- flux: plot flux [photons/s/cm^2/keV] and not [counts/bin]
- overplot: Overplot previous plot
- type: defines what should be plotted. It can have the values 'model', 'data', 'res' (residuals), 'ratio', 'diff' (difference between model an data. By default model and data is plotted.)
- nolabel: The routine uses the labels given in 'plot_options' and does not create its own.
- space: If at the qualifer 'type' data, model or diff is chosen, one can specifiy if it is plotted in counts/bin (by default), counts/keV/s ('density') or photons/keV/s/cm^2 ('flux').
- auto: Set the ranges automatically.
- xauto: Set the x-range automatically.
- yauto: Set the y-range automatically.
- unit: Specifies the unit of the x-axis. By default the unit from the fitstable is taken. Possible values are 'keV' or Angstrom 'A'.
Description
This function is designed to plot the data which was saved with 'save_plot' in a fits-file. Using the qualifiers you can choose how the data should be displayed. By default the model and the data is plotted in counts/bin.
The data, model and diff qualifier can be combined with the qualifier 'flux' in order to plot in photons/s/cm^2/keV instead of counts/bin.
To define the colors of the plot, you have to provide an array of colors. The length of the array is equal to the number of loaded spectra, as each color is associated with the spectra in the same order given in the fits-file.
If you provide the array 'dataset', only these spectra are plotted. The numbers are assinged according to the order of the single spectra in the extension of the fits-file. Using for example 'fv ', you can easily look up these numbers, as the instrument which created the desired spectrum is also named in the header of each extension.
Examples
% save one dataset in a fits-file save_plot("my_data",1); % plot data and model in flux and the residuals in an additional panel % -the data should be in red, color(2) and the data in black, color(1) % -the ranges are set automatically multiplot([3,1]); fplot("my_data",2;type="data",space="flux",auto); ofplot("my_data",1;type="model",space="flux",auto); ofplot("my_data",2;type="res",auto);
See also: save_plot
get_contour_lines
Synopsis
finds a set of contour lines for a 2d-array of values
Usage
Struct_Type l[] = get_contour_lines(Double_Type f[], Double_Type f0);
Qualifiers
- save: filename of a FITS file to save contours
Description
f
has to be a two-dimensional array (an image).
The return value is an array of struct { x, y }
,
whose fields x
and y
contain the indices
for the contour line f[y,x] = f0
.
get_rainbow_col
Synopsis
get a rainbow color
Usage
color = get_rainbow_col(Integer_Type value, Integer_Type num_colors);
Description
The value has to be within [0:num_colors-1], to get the correct color here.
See also: xfig_new_color
get_sron_colors
Synopsis
get colors for different data, with good color blind readability
Usage
String_Type colors = get_sron_colors(Integer_Type number)
or
```c
Struct_Type colors = get_sron_colors(Integer_Type number ; names)
or
String_Type color = get_sron_colors(Double_Type value ; cont)
##### Description
The color schemes in this function are based on SRON Technical
note SRON/EPS/TN/09-002 (Issue 2.2 from 2012-12-29): "Colour
Schemes" prepared by Paul Tol. Three color schemes are avaible:
- a quantitative (default): up to 12 distinct colors, not sorted
(based on Fig. 3)
- a diverging continuous one, running from blue to red (Fig. 8)
- a continouos rainbow one (Fig. 13)
Selection of the color schemes is done with the qualifier "type"
("qualitative" (default), "diverging" or "rainbow")
The function returns the hex-code strings for each color.
For the quantitative scheme it is also possible to return a
structure with colornames and hex value (qualifier "names").
For the continouous schemes it is also possible to get the color
corresponding to a (float) value between 0 and 1 (qualifier
"cont").
##### Qualifiers
* type: =String_Type select color scheme ("qualitative" (default),"diverging", or "rainbow"
* names: (Boolean) return color names in structure for qualitative color scheme
* cont: (Boolean) change meaning of argument to value between 0 and 1, return corresponding color
#### hplot_filled
##### Synopsis
plot a filled histogram defined by slang arrays
##### Usage
```c
hplot_filled(Array_Type bin_lo, Array_Type bin_hi, Array_Type values)
Qualifiers
- fill_style [
=1
]: set the fill style:
FS = 1
=>
solid (default)
FS = 2
=>
outline
FS = 3
=>
hatched (cannot be used with ylog;)
FS = 4
=>
cross-hatched (cannot be used with ylog;)
- ticks [
=""
]: set to"I"
or"P"
to invert or project the ticks of both axis (additional to initial plot options) - xopt [
=get_plot_options.xopt
]: set the plot options of the x-axis directly - yopt [
=get_plot_options.yopt
]: set the plot options of the y-axis directly - ymin [
=min(values)
]: set the lower y-value to which the areas are filled - angle [
=degrees
]: sets the angle of the hatched lines for FS=3 [default = 45]
Description
This function plots a histogram described by three 1-D S-Lang arrays of size N. The area below the histogram is filled. The fill style can be selected with a qualifier.
Examples
hplot_filled([1:5],[2:6],[1:5]);
%
invert the ticks
hplot_filled([1:5],[2:6],[1:5]; ticks="I");
%
change the fill style
hplot_filled([1:5],[2:6],[1:5] ; fill_style=4);
See also: ohplot_filled, hplot
hplot_with_err
Synopsis
plots histogram data points with errorbars
Description
This function passes all its arguments and qualifiers to the
plot_with_err
function, but adds the histogram
and xminmax
qualifiers.
See also: [o][h]plot_with_err, [o][h]plot
image2rgb
Synopsis
converts an image (2d array) to a 24bit RGB image
Usage
Integer_Type rgb[] = image2rgb(Double_Type img[]);
or
Integer_Type rgb[] = image2rgb(Double_Type R[], G[], B[]);
Description
min(img)
will be mapped to black, max(img)
to white,
and other values to their linear gray scale.
This function can be used for png_write
(_flipped
).
See also: png_write
init_plot
Synopsis
starts a new plot, such that other plots can be overplotted
Usage
init_plot();
Description
plot is used to plot a single point in the lower left corner. Before init_plot is called, x- and yrange have to be set.
See also: plot, get_plot_options
keV2erg
Synopsis
convert flux to erg
Usage
Double_Type new_value = kev2erg(Double_Type old_value)
Qualifiers
- y_fac: divide the value by 10^{y_fac}
See also: plot_unfold
multiplot_flux_counts_res
Synopsis
creates a plot of model flux, data counts and residuals in 3 panels
Usage
multiplot_flux_counts_res(data_ind[, rel_size]);
Description
If data_ind is an array of data-indices, the data will be rebinned to the grid of the first index.
new_printplot
Synopsis
returns a new printplot-structure
Usage
Struct_Type new_printplot(Double_Type x0, x1, y0, y1);
Qualifiers
W, H : the width, i.e. the number of columns, and the height, i.e. the number of rows, of the plotting area without any axes or ticmarks (default: 60 and 10) [x,y]axis : if set to zero do not draw the axis [x,y]tics : if set to zero do not draw the ticmark [x,y]format: sprintf format of the tics (default: "%f") [x,y]strlen: maximum string length of the ticmarks (default: 4)
Description
For printing a simple plot into the terminal a char matrix is returned by this function, which can be later printed by 'printplot_out'. Per default, the matrix is 20x4 in size. Changing its size can be done by the W- and H-qualifiers. The arguments specify the x- and y-ranges of the plotting area. The minimum and maximum values are the only ticmarks which are added. Note that the char-matrix is enlarged to fit the axes and ticmarks.
See also: printplot_out, printplot, printhplot
ohplot_filled
Synopsis
over-plot a filled histogram defined by slang arrays
Usage
ohplot_filled(Array_Type bin_lo, Array_Type bin_hi, Array_Type values)
Qualifiers
- fill_style [
=1
]: set the fill style:
FS = 1
=>
solid (default)
FS = 2
=>
outline
FS = 3
=>
hatched (cannot be used with ylog;)
FS = 4
=>
cross-hatched (cannot be used with ylog;)
- ymin [
=min(values)
]: set the lower y-value to which the areas are filled - angle [
=degrees
]: sets the angle of the hatched lines for FS=3 [default = 45]
Description
This function overplots a histogram described by three 1-D S-Lang arrays of size N. The area below the histogram is filled. The fill style can be selected with a qualifier.
Examples
ohplot_filled([1:5],[2:6],[1:5]);
See also: hplot_filled, hplot
ohplot_with_err
Synopsis
overplots histogram data points with errorbars
Description
This function passes all its arguments and qualifiers to the
hplot_with_err
function, but adds the overplot
qualifier.
See also: [o][h]plot_with_err, [o][h]plot
open_plot_ps2eps
Synopsis
opens a plot and saves .ps filename for latter use of ps2eps
Usage
Integer_Type id = open_plot_ps2eps(device[, nxpanes[, nypanes]]);
Description
open_plot_ps2eps
passes its arguments to open_plot
.
If used together with close_plot_ps2eps
, an .eps file
is finally produced from an usual PGPLOT .ps output
through the external tool ps2eps. Therefore, device
has to be
a .ps
file with /
[v
][c
]ps
specification.
Qualifiers
- ps2epsopt [="-R=+ -B -f"]: option for ps2eps
- noremoveps: the .ps file will not be removed after conversion
- pre_enlargeBB: enlarge bounding box by specified value [=1, if none specified] before ps2eps
- pre_run_cmd=cmd: command to run before ps2eps.
The ps-file is passed to
cmd
as an argument.cmd
is expected to write the modified ps file tostdout
. - enlargeBB: enlarge bounding box by specified value [=1, if none specified] after ps2eps
See also: open_plot, close_plot_ps2eps
oplot_contour_lines
Synopsis
overplots contour lines of a 2d array (image)
Usage
oplot_contour_lines(f, f0[, X, Y]);
Qualifiers
- save=filename: saves/restores the contour lines in a FITS file
- pgplot: uses
_pgline
instead ofoplot
Description
f
has to be a two-dimensional array (an image).
f0
is the value of the contour lines f[y,x] = f0
.
The arrays X
and Y
, if present, transform the array-indices x
and y
to the coordinate system used for plotting.
See also: get_contour_lines
oplot_rect
Synopsis
overplots a rectangle
Usage
oplot_rect(Double_Type x1, y1, x2, y2);
or
oplot_rect(Double_Type [x1, x2], [y1, y2]);
oplot_struct_arrays
Synopsis
overplots the fields of a structure agains each other
Usage
oplot_struct_arrays(Struct_Type s, String_Type fieldnameX, String_Type fieldnameY);
Qualifiers
- xoffset
- yoffset
Description
oplot(s.fieldnameX - xoffset, s.fieldnameY - yoffset);
oplot_with_err
Synopsis
overplots data points with errorbars
Description
This function passes all its arguments and qualifiers to the
plot_with_err
function, but adds the overplot
qualifier.
See also: [o][h]plot_with_err, [o][h]plot
oplot_xline
Synopsis
overplots one or more vertical line(s)
Usage
oplot_xline(Double_Type x1[, x2, ...]);
Qualifiers
- ymin [=<minimum of current
yrange
>] - ymax [=<maximum of current
yrange
>] - color: number of the color to use
Description
For each x
of x1
[, x2
, ...] (which may be arrays, too),
a line is overplotted from ymin
to ymax
with the same color
.
oplot_yline
Synopsis
overplots one or more horizontal line(s)
Usage
oplot_yline(Double_Type y1[, y2, ...]);
Qualifiers
- xmin [=<minimum of current
xrange
>] - xmax [=<maximum of current
xrange
>] - color: number of the color to use
Description
For each y
of y1
[, y2
, ...] (which may be arrays, too),
a line is overplotted from xmin
to xmax
with the same color
.
plot_contour_trq
Synopsis
creates a contour plot out of the results from function contour_trq.
Usage
plot_contour_trq(String_Type inputDir);
Qualifiers
- out: post script outputname
- image: fits image outputname
- x: x label
- y: y label
Description
-
inputDir
directory where all torque job files are, created by function contour_trq.
Be aware of the issues with the torque (look at the description of contour_trq function), as it may not have all bins^2 values, and hence give wrong contour plot.
The default post script file name is cont_default.ps. Output fits image file is cont_default.fits.
EXAMPLE
plot_contour_trq("fileDirectory";out="my_out",x="x_lab",y="y_lab");
creates a plot "my_out.ps" with x-axis label named "x_lab" and y_axis label named "y_lab".
See also: contour_trq, missing_contour_trq
plot_struct_arrays
Synopsis
plots the fields of a structure agains each other
Usage
plot_struct_arrays(Struct_Type s, String_Type fieldnameX, String_Type fieldnameY);
Qualifiers
- xoffset
- yoffset
Description
plot(s.fieldnameX - xoffset, s.fieldnameY - yoffset);
plot_table_columns
Synopsis
plots columns of a table against each other
Usage
plot_table_columns(Struct_Type table);
Qualifiers
- x: array of columns to be used for the x-axis [default: all columns]
- y: array of columns to be used for the y-axis [default: all columns]
- path: path to save the postscript plots
- multiplot: produce one single multiplot (does not call open_plot)
plot_with_err
Synopsis
plots data points with their errorbars
Usage
plot_with_err(x, [xErr,] y, yErr);
or
plot_with_err(Struct_Type s);
Qualifiers
- xerr: change 3-argument-syntax to
plot_with_err(x, xErr, y);
- xminmax: changes the meaning of
xErr
-- andx
, ifxErr
is not a list - yminmax: changes the meaning of
yErr
-- andy
, ifyErr
is not a list - minmax: equivalent to both
x
- andyminmax
- i: index-array of subset of data points to be plotted
- set_xrange=frac (default: 0.05): set the
xrange
from the lowest to highest x-value with additional padding (given as a fraction fo the x-range) on both sides - set_yrange=frac (default: 0.05): set the
xrange
from the lowest to highest y-value with additional padding (given as a fraction of the y-range) on both sides - set_ranges: equivalent to both
set_xrange
andset_yrange
- overplot: The data will be overplotted.
- connect_points: data points are also connected
- histogram: draw histogram lines, too
- error_color: draw error bars in a different color
Description
In order to use asymetric errors for x and/or y,
the correspondig Err
argument has to be a list { Err1, Err2 }
.
If one of the minmax
qualifiers is used,
the corresponding Err
list contains directly minimum and maximum values.
If one of the minmax
qualifiers is used, but Err
is not a list,
the value and Err
arguments actually mean minimum and maximum values.
The actual value is infered to be the mean of minimum and maximum.
Examples
% examples with symmetrical errorbars:
plot_with_err(x, y, yErr);
plot_with_err(x, xErr, y, yErr);
plot_with_err(x, xErr, y, ; xerr);
% examples with unspecified x and/or y value:
plot_with_err(xMin, xMax, y , yErr; xminmax); % => x = (xMin+xMax)/2
plot_with_err(x[, xErr], yMin, yMax; yminmax); % => y = (yMin+yMax)/2
plot_with_err(xMin, xMax, yMin, yMax; minmax); % => [both inferences]
s = struct { bin_lo=x-xErr, bin_hi=x+xErr, value=y, err=yErr };
plot_with_err(s);
% examples with asymmetrical errorbars: plot_with_err(x, {xErr1, xErr2}, y, {yErr1, yErr2});
plot_with_err(x, {xMin, xMax }, y, {yMin, yMax}; minmax);
% example combining the above features:
plot_with_err(xMin, xMax, y, {yMin, yMax}; minmax); % => x = (xMin+xMax)/2
See also: [o][h]plot_with_err, [o][h]plot
plot_with_y2axis
Synopsis
plot two functions with different y-axes
Usage
plot_with_y2axis(x1, y1, [ x2,] y2);
Qualifiers
- color: set the color of the 2nd y-axis [default: red]
- yspace: space above and below the last data point in units of the total y-range.
Description
This function plots two different parameters y1 and y2, which depend on the same paramter x. By default, the same x is taken for both parameters.
The y2-axis and the ranges are set automatically.
Additionally the function returns the rescaled y2 values, which now lie in the range of the y1 values.
point_distance2_from_line
Synopsis
Calculate the squared distance of a point from a line
Usage
d2=point_distance2_from_line(xp,yp,x1,y1,x2,y2)
Description
Calculate the distance of point (xp,yp) from the line defined by the points P1=(x1,y1) and P2=(x2,y2), where P1!=P2. This condition is not tested for speed reasons and will result in a division by zero.
printhplot
Synopsis
print a plot of a histogram into the terminal
Usage
printplot(Double_Type[] lo, hi, values[, Struct_Type printplot]);
Qualifiers
sym: the char used for the bar (default: 'o') get: return the structure instead of printing
all qualifiers are passed to new_printplot
Prints a very simpel ASCII-version of plotting the given histogram into the terminal. The x- and y-ranges are defined automatically by the input, but can be specified via the optional printplot-structure (see 'new_printplot'). The only drawn ticmarks represent these ranges.
Example
% plot gaussian distributed random numbers (lo,hi) = linear_grid(-3, 3, 40); printhplot(lo, hi, histogram(grand(10000), lo, hi); W=40);
See also: new_printplot, printplot
printplot
Synopsis
print a plot of xy-values into the terminal
Usage
printplot(Double_Type[] x, y[, Struct_Type printplot]);
Qualifiers
sym: the char used for a data point (default: 'x') get: return the structure instead of printing
all qualifiers are passed to new_printplot
Description
Prints a very simpel ASCII-version of plotting the given xy-values into the terminal. The x- and y-ranges are defined automatically by the input, but can be specified via the optional printplot-structure (see 'new_printplot'). The only drawn ticmarks represent these ranges.
Example
% plot a sin x = [0:2*PI:#100]; printplot(x, sin(x));
% overplot a cosin printplot(x, .5*cos(x), printplot(x, sin(x); get); sym = '*');
See also: new_printplot, printhplot
printplot_out
Synopsis
print a char-matrix into the terminal
Usage
printplot_out(Char_Type[] matrix);
See also: new_printplot
read_data_from_write_plot
Synopsis
reads data that was saved with "write_plot" in a structure
Usage
Structure str = read_data_from_write_plot(String_Type file)
Qualifiers
- no_res: no residuals should be loaded
- no_mod: no model included in dat file, implies no_res
- y_fac[=0]: scale the y-axis by 10^{y_fac}
Description
This function reads data from a plot saved with "write_plot" and returns it in a structure which can be used for plotting.
The structure tags are: lo: low energy hi: high energy val: data value err: uncertainty of the data value model: model value of fit res: residual res_min: lower error bar res_max: upper error bar
IMPORTANT: The filename has to be given without the ".dat" ending!
Note that if the data were saved with plot_unfold(...;...,power=3); the values are automatically converted to ergs/s/cm^2
See also: xfig_plot_unfold,xfig_plot_data,read_col,write_plot
save_plot
Synopsis
saves ISIS spectral data into a FITS file
Usage
save_plot([filename[, ids]]);
Qualifiers
- A: Save the data in Angstrom and not in keV.
Description
This functions saves all data and model points as currently noticed and rebinned to the file 'filename'.fits. Each dataset is stored in an own extension. The current model is save in 'filename'.par. By default the name 'save_plot' is chosen.
Hereby the values are given in counts/bin and in photons/s/cm^2/keV. To calculate the flux from the observed data, the function get_convolved_model_flux() was used.
Additionally, information on the instrument, the target, the grating, the filename of the model, the functions used for the model and the frame time are stored in the header.
setPGPLOTenv
Synopsis
sets environment variables used by PGPLOT
Usage
setPGPLOTenv(Double_Type w, h[, hoff[, voff]]);
Qualifiers
- gif: sets the PGPLOT_GIF enviroment variables
Description
The environment variables for the PGPLOT postscript driver,
PGPLOT_PS_{WIDTH,HEIGHT,HOFFSET,VOFFSET}
, are set
to the specified width w
and height h
. The default
horizontal and vertical offset is hoff=0
and voff=0
.
The parameters w
, h
, hoff
, voff
specify the size in cm,
while the enviroment variables are measured in milli-inches.
If the gif
qualifier is given, PGPLOT_GIF_{WIDTH,HEIGHT}
are set to w
and h
(in pixels).
See also: putenv, http://www.astro.caltech.edu/~tjp/pgplot/devices.html
x1axis
Synopsis
(re)draws a first x-axis
Usage
x1axis(Double_Type min_value, Double_Type max_value[, Double_Type step]);
Qualifiers
- nsub [=0]: number of minor tick marks within each major divison (nsub=0 => no minor ticks)
- maji [=0.5]: length of major tick marks, drawn inwards (in units of the character height)
- majo [=0]: length of major tick marks, drawn outwards (in units of the character height)
- fmin [=0.5]: length of minor tick marks (as fraction of the major tick marks)
- disp [=0.5]: displacement of baseline of tick labels to the axis (in units of the character height)
- angle [=0]: orientation of the text (in degrees)
- color [=1]: color of the axis
- linewidth [=1]: line width of the axis
- opt [="N"/"LN"]: pgaxis-options: "L" (log), "N" (numbers), "1" (force decimal), "2" (force EE)
- yrel [=0]: relative position of the x1axis (0=bottom, 1=top)
- xmin [=xmin]: absolute x-position of the axis
- xmax [=xmax]: absolute x-position of the axis
See also: x2axis (and references therein)
x2axis
Synopsis
draws a second x-axis
Usage
x2axis(Double_Type min_value, Double_Type max_value[, Double_Type step]);
Qualifiers
- nsub [=0]: number of minor tick marks within each major divison (nsub=0 => no minor ticks)
- maji [=0.5]: length of major tick marks, drawn inwards (in units of the character height)
- majo [=0]: length of major tick marks, drawn outwards (in units of the character height)
- fmin [=0.5]: length of minor tick marks (as fraction of the major tick marks)
- disp [=0.5]: displacement of baseline of tick labels to the axis (in units of the character height)
- angle [=0]: orientation of the text (in degrees)
- color [=1]: color of the axis
- linewidth [=1]: line width of the axis
- opt [="N"/"LN"]: pgaxis-options: "L" (log), "N" (numbers), "1" (force decimal), "2" (force EE)
- yrel [=1]: relative position of the x2axis (0=bottom, 1=top)
- xmin [=xmin]: absolute x-position of the axis
- xmax [=xmax]: absolute x-position of the axis
Description
x2axis
has to be called after the plot window is drawn.
It relies on the world coordinates set by xrange
, yrange
.
The automatical x2axis can be switched off with change_plot_options
.
Example
()=change_plot_options(; xopt="BNST"); % default: "BCNST", see _pgbox xrange(0, 360); yrange(-1.1, 1.1); plot([0:360], sin([0:2*PI:#361])); x2axis(0, 2);
See also: _pgaxis, change_plot_options, coords_in_box, y2axis, x1axis, y1axis
x2axis_with_tics
Usage
x2axis_with_tics(Double_Type X[][, Label]);
Qualifiers
- ftick[=0.08]: fraction of box-height that tick marks are below axis
- flabel[=0.05]: fraction of box-height that labels are above axis
x2label
Synopsis
labels the second x-axis
Usage
x2label(String_Type s);
Qualifiers
- color [=1]: textcolor
- f [=0.03]: fraction of the plot-area's height that the label is above
See also: xylabel
xfig_3d_orbit_on_cube
Synopsis
Visualize 3d orbits by projecting them onto a cube
Usage
xfig = xfig_3d_orbit_on_cube(Struct_Type orbits [, Struct_Type text]; qualifiers)
Description
The orbits have to be given in cartesian coordinates (x,y,z) and are passed to the function via a structure. Each individual orbit is itself a structure with fields 'x', 'y', and 'z'. The orbits are then visualized by plotting the projections to the xy-, xz-, and yz-plane on the surfaces of a cube. Use the qualifiers to change the viewing angle, labels, or properties of the cube and the background grid. The function's optional second argument can be used to add text or symbols to the plot (see example section below).
Notes
If one of the three coordinates is missing, the projection on the plane defined by the remaining two coordinates is still plotted. This feature can be used to add lines or text to one specific plane only.
The properties of the orbits (line style, color, ...) can be changed by adding the field 'qualies' to the structure that decribes the orbit. The field 'qualies' is again a structure whose fields are qualifiers of the function 'xfig_new_polyline'.
Qualifiers
- phi [=-45]: Azimuthal angle in the x-y-plane in degrees (-90 < phi < 0).
- theta [=60]: Polar angle from the z-axis in degrees (0 < theta < 90).
- dist [=1e6]: Distance of the eye from the focus.
- scale [=4]: Factor to scale dimensions with respect to the character size (scale > 0).
- x_label [="$x$,(kpc)"]: x-label.
- y_label [="$y$,(kpc)"]: y-label.
- z_label [="$z$,(kpc)"]: z-label.
- digits [=1]: Digits for ticmarks (a non-negative integer).
- cube: Modify the cube by providing a structure whose fields are qualifiers of the function 'xfig_new_polyline'.
- grid: Modify the grid by providing a structure whose fields are qualifiers of the function 'xfig_new_polyline'.
- center: Center the cube at (0,0,0).
- z_adjust: Use separate scale for z-axis.
Example
% basic example: o = struct{ orbit1, orbit2, orbit3 }; o.orbit1 = struct{ x=[0,1], y=[0,1], z=[0,1] }; o.orbit2 = struct{ x=[1,1], y=[4,1], z=[-3,0], qualies=struct{color="blue"} }; o.orbit3 = struct{ x=[-1,0,1], y=[-1,1,-1], qualies=struct{closed, fillcolor="tomato", depth=5} }; % filled triangle in the xy-plane xfig = xfig_3d_orbit_on_cube(o); xfig.render("test.pdf"); xfig_set_eye(1e6,0,0,0); % restore the default position of the eye
% adding text to xy-plane: t = struct{ triangle=struct{text="triangle", x0=0, y0=0, depth=4} }; xfig_3d_orbit_on_cube(o,t).render("test.pdf"); xfig_set_eye(1e6,0,0,0); % restore the default position of the eye
% example involving the function 'orbit_calculator': o = orbit_calculator([12,12],[22,22],[29.6,29.6],[40,40],[49,49],[36,36],[3.078,4],[262,262],[-13.52,-13.52],[16.34,16.34],-1000; r_disk=50, set); set_struct_field(o.tr, "o0", struct_combine(o.tr.o0, "qualies")); set_struct_field(o.tr.o0, "qualies", struct{ color="red", depth=2, backward_arrow }); set_struct_field(o.tr, "o1", struct_combine(o.tr.o1, "qualies")); set_struct_field(o.tr.o1, "qualies", struct{ color="blue", depth=1, backward_arrow }); xfig_3d_orbit_on_cube(o.tr).render("test.pdf"); xfig_set_eye(1e6,0,0,0); % restore the default position of the eye
% changing the appearance of the cube and grid: xfig_3d_orbit_on_cube(o.tr; cube=struct{color="red",width=2}, grid=struct{line=0}).render("test.pdf"); xfig_set_eye(1e6,0,0,0); % restore the default position of the eye
% adding symbols: t = struct{ sun, gc }; t.sun = struct{ text="$\odot$", x0=-8.4, y0=0, z0=0, depth=3 }; t.gc = struct{ text="+", x0=0, y0=0, z0=0 }; xfig_3d_orbit_on_cube(o.tr, t).render("test.pdf"); xfig_set_eye(1e6,0,0,0); % restore the default position of the eye
See also: orbit_calculator
xfig_compress_eps
Synopsis
Compresses an EPS-File via "pdftops -level3 -eps"
Usage
int = xfig_compress_eps(String_Type file)
Description
PS and EPS-Files created with xfig are usually much too large. Using this function the size can be reduced by a factor of few. Simply call this function after creating a PS or EPS with ".render(file)".
xfig_draw_orbit
Synopsis
draws the orbit of a binary system into an exsiting xfig-object and allow also to highlight specific phases
Usage
xfig_draw_orbit(Xfig_Object xf, Double_Type asini, i, ecc, omega, rstar)
Qualifiers
- line_color [
="gray"
]: color of the lines showing the coordinate main axes and the orientation of the semi-major axis of the orbit - phases [
={}
]: list of Double_Type[2] arrays indicating the phases which should be highlighted - scale [
=1.05
]: compression/streching for the highlighted phases over/under the orbit - phase_color [
="red"
]: color of the highlighted phases, can be a single string or an array of strings, with the same length as phases so that every highlighted phase can be drawn in a different color. - phase_width [
=2
]: width of the highlighted phases, can also be an array, just as phase_color. - star_color [
=lightblue
]: fill-color of the companion star - trueanom : if set, phases are given in true anomaly, i.e., equal delta-phi values will correspond to equal delta-t on the orbit.
- zerolines [
=1
]: plot x- and y-axis lines through [0,0] - phaselines : draw a lightgray line every phase n*0.1 and label it
- label_phase_switch [
=0
] : phase at witch phase labels are switched from before the line to after the line. - label_pos [
=0.85
] : distance of the phase labels from the orbit line, in fraction of distance to center. - nolabel : removes the coordinate system
Description
This function plots the orbit of a binary system as seen from above into a given xfig-object. The orbital parameters asini (semi-major axis, in lt-sec), i (inclination, in deg), ecc (eccentricity), omega (argument of periastron, in deg) and the radius rstar (in r_sun) of the companion star need to be supplied. Qualifiers are passed through the xfig-plotting routine of the orbit.
Examples
%orbit parameters of GX 301-2 according to Koh et al (1997). variable asini = 368.3 ; % lt-sec (semi major axis) variable i = 66; % degree to rad variable ecc = 0.462 ; % variable omega = 310.4 ; % degrees variable rstar = 43 ; % solar radii in lt-sec
variable xfgx = xfig_plot_new(12,12) ; xfgx.world(-600,450,-450, 600) ; xfig_draw_orbit(xfgx, asini, i, ecc, omega, rstar ; phases={[0.9184,0.9315]}, phase_color="red", phase_width=4, scale=1) ; xfgx.plot([0,0],[-100,-370] ; line=1, forward_arrow, depth = 10, arrow_thickness =2) ; xfgx.xylabel(0,-400, "To Earth"); xfgx.render("plots/gx301_skizze2.eps") ;
See also: ellipse
xfig_draw_orbit_3D
Synopsis
draws the orbit of a binary system in 3D
Usage
Xfig_Object xfig_draw_orbit([Xfig_Object xf,] Double_Type asini, i, ecc, omega);
Qualifiers
caminc - the camera inclination to the line of sight (in degrees; default: 90-i) camroll - the camera roll angle around the z-axis (along the line of sight; in degress; default: 0)
Description
Similar to 'xfig_draw_orbit' this function plots the orbit of a binary, but seen from a user-defined direction and, thus, in 3D. In order to draw the orbit the projected semi-major axis (asini), inclination (i), eccentricity (ecc), and longitude of periastron (omega) have to be provided.
Additionally to the orbital plane the tangent plane of the sky is drawn as well. This plane is defined to be perpendicular to the line of sight and through the center of mass, i.e. the focal point of the eccentric orbit nearest to the periastron (P). Thereby, the observer is located below the tangent plane of the sky, indicated by the arrow pointing to Earth. All dashed lines are within the orbital plane, which are the intersection of the orbital and tangent plane of the sky, the semi-major and -minor axis (in red), and the line connecting the orbit's center and the periastron. The projected semi-major axis (asini) is drawn as dotted dashed line.
The camera is controlled via qualifiers and by default the binary is seen face-on.
Note that so far only basic functionallity have been implemented.
See also: xfig_draw_orbit, ellipse
xfig_get_normalized_x_position
Synopsis
Compute normalized (world0) x-position from world1 x-position
Usage
xnorm=xfig_get_normalized_x_position(p,xval)
Description
For a given xfig plot p and x-coordinate value xval given in the world1 coordinate system, compute the corresponding normalized world0 x-value.
This function is necessary since the xfig module does not export its world normalization functions. It is heavily based on these.
See also: xfig_get_normalized_position,xfig_get_normalized_y_position
xfig_get_normalized_y_position
Synopsis
Compute normalized (world0) y-position from world1 y-position
Usage
ynorm=xfig_get_normalized_y_position(p,yval)
Description
For a given xfig plot p and y-coordinate value yval given in the world1 coordinate system, compute the corresponding normalized world0 y-value.
This function is necessary since the xfig module does not export its world normalization functions. It is heavily based on these.
See also: xfig_get_normalized_position,xfig_get_normalized_x_position
xfig_multibox
Synopsis
combines M x N xfig-objects in one box
Usage
pl = xfig_multibox(XFig_Plot_Type pl[M,N] [, Double_Type spacing])
Qualifiers
- rotate: switch the meaning of M and N
See also: xfig_new_vbox_compound, xfig_new_hbox_compound
xfig_plot_colormap
Synopsis
Plots a colormap/colorscale
Usage
Struct_Type xfig_plot_new( Double_Type[n,m] IMG );
Qualifiers
- cmap [="ds9b"]: Either a name (String_Type) of a colormap (see png_get_colormap_names), or a self defined colormap (Integer_Type[]).
- gmin [=min(IMG)]: Minimal value of image to be plotted
- gmax [=max(IMG)]: Maximal value of image to be plotted
- W [=14]: Plot width [cm]. 'ratio' is overwritten if W & H are given!
- H [=W/ratio]: Plot height [cm]. 'ratio' is overwritten if W & H are given!
- orientation [=1]: Horizontal if 1, vertical if 0. Set Horizontal if W/H > 1, otherwise set to vertical.
- label: Label for the colormap
- format: Format for colormap axis ticlabels, see 'help xfig_plot.axis'
- depth [=80]: Depth of the colormap
- fontsize [="scriptsize"]: Font size of tic & axis label
- ticlen [=.15]: Length of major tic marks (minor tic are .5*ticlen).
- maxtics [=5]: Maximal number of labeled tics
- box : Draws a box behind the colormap
- border [=.01]: Relative size of box excess length
- boxcolor [="#FFFFFF"]: Color of the box
Description
This function uses xfig_plot_image to create a colormap based on the given IMaGe (with dimension n and m).
Example
variable x = [PI:10*PI:#100]; variable y = [PI:5*PI:#80]; variable IMG = sin(x) # transpose(cos(y)); variable xf = xfig_plot_colormap( IMG ); xf.render("/tmp/test.pdf");
See also: xfig_plot_new, %.shade_region, xfig_plot_image
xfig_plot_conf
Synopsis
plots contour levels stored with save_conf
Usage
XFig_Plot_Type pl = xfig_plot_conf(String_Type file[, XFig_Plot_Type pl])
Qualifiers
- lvls: specify the Delta chi-sqr values for the contour levels, default: [2.30, 4.61, 9.21], i.e., 1 sigma, 90% and 99% CL
- color: specify the colors of the contour lines The array's last value is used for the best fit's cross (if length of array > number of levels).
- line [=0]: specify the line styles of the contour lines
- width [=1]: specify the width of the contour lines The array's last value is used for the best fit's cross.
- smooth [=1]: this integer>=1 specifies the interpolation factor for the image used to calculate the contours
- W: width of the plot if created by
xfig_plot_contours
- H: height of the plot if created by
xfig_plot_contours
- transpose: transposes the countour map (exchange x- and y-values)
- nocross: do not plot best fit cross
Description
If no SLxfig plot object pl
is given, a new one is created
and its world coordinate system is defined according to the
ranges used to calculate the confidence map. x- and y-labels
are initialized with the parameter names, but can be changed
afterwards.
See also: get_confmap, xfig_plot_new, enlarge_image
xfig_plot_confmap
Synopsis
Create an xfig plot of a confidence map
Usage
xfig_plot_new fig = xfig_plot_confmap(String_Type cm; qualifiers)
Description
Create an xfig plot from a pre-calculated confidence map cm' computed and saved with the function
get_confmap'.
Qualifiers
- best_fit: Mark the best fit with a cross.
- CDF: If set to a positive integer, the chi^2 values are converted to a cumulative distribution function with the degree of freedom given by this qualifier. For instance, CDF=1 implies that chi^2 values of 1, 2.71, and 6.63 are converted to 0.68, 0.9, and 0.99 (this qualifier requires the gsl-module).
- colormap [="haxby"]: Choose, e.g., "ds9sls", "seis", "rainbow", "haxby", "topo", "globe" (see the function `png_get_colormap' for more information).
- colormap_gmin, colormap_gmax: Minimum and maximum grayscale value for the colormap, see `png_gray_to_rgb'.
- chi2 [=Double_Type[0]]: Chi^2 values for which contour lines should be drawn (this qualifier requires the gcontour-module).
- chi2_color [="magenta"]: Color of the contour lines and the best fit cross.
- factor [=1]: Factor by which the x- and y-sampling of the confidence map is increased.
- field [="chisqr"]: Which field of the confidence map shall be plotted.
- width [=8], height [=8]: Width and height of the confidence map.
- latex_package [="txfonts"]: Load a package in the preamble of LaTeX documents.
- reverse_axes: If present, both axes are reversed.
- [xyz]label: Add a x-, y-, or z-label to the confidence map.
- [xyz]axis [=struct{ticlabels_confine=0, ticlabels2=0}]: Modify the x-, y-, or z-axis
by providing a structure whose fields are qualifiers of the function
xfig_plot.axis'. Note that the
log' qualifier (set logarithmic axis scale) does not work. - nomultiplot: Return the confidence map and its corresponding colormap in two separate xfig objects instead of one multiplot object.
Example
fig = xfig_plot_confmap("confmap.fits"; chi2=[1, 2.71, 6.63], zlabel="$\chi^2$"R, zaxis=struct{format="%g", ticlabels1=0}); fig.render("test.pdf");
See also: get_confmap
xfig_plot_data
Synopsis
plots data which was loaded by "read_data_from_write_plot"
Usage
XFig_Plot_Type pl = xfig_plot_data(XFig_Plot_Type pl, Struct_Type dat)
Qualifiers
- color: specify the color
- width: line width
- depth: depth in plot
- pp: data are plotted twice (pulse profile)
See also: xfig_plot_unfold,read_data_from_write_plot,read_col,write_plot
xfig_plot_epfpd
Synopsis
plot the results of epfoldpdot with Xfig, including the pulse profile of the stronges P/P-dot values
Usage
xfig_plot_epfpd(Struct_Type eppd, Struct_Type lc)
Qualifiers
- W : width of resulting plot (default=12)
- H : height of resulting plot (default=W)
- pdstart : start of P-dot axis (default read from eppd)
- pdstop : end of P-dot axis (default read from eppd)
- pstart : start of P axis (default read from eppd)
- pstop : end of P axis (default read from eppd)
- p0 : center of P axis (default mean of periods in eppd)
- cmap [
="iceandfire"
]: Color-map of Chi^2 landscape - cont : switch to plot FWHM contour on map
- pp : switch to plot pulse profile below map
- t0 [
="0"
]: t0 for pulse profile - nbins [
="12"
]: number of phase bins for pulse profile
Description
This function plots the results for "epfoldpdot" into a nice colorful xfig image, with the cuts in P and P-dot over the most significant period as well as (if desired) the pulse profile of that period. This style of plot is inspired by the results plots of PRESTO.
This code is still under development and not very flexible yet. Feel free to improve it.
See also: epfoldpdot
xfig_plot_image
Synopsis
Plots an image (with x/y-grid)
Usage
Struct_Type xfig_plot_new( Double_Type[n,m] IMG, [Double/Struct_Type x, y] );
or
```c
xfig_plot_new( Double_Type[n,m] IMG, [Double/Struct_Type x, y [, Struct_Type xf]] );
##### Qualifiers
* cmap [="ds9b"]: Either a name (String_Type) of a colormap
(see png_get_colormap_names), or a self defined
colormap (Integer_Type[]).
* gmin [=min(IMG)]: Minimal value of image to be plotted
* gmax [=max(IMG)]: Maximal value of image to be plotted
* xmin [=min(x)]: Minimal value of x-axis
* xmax [=max(x)]: Maximal value of x-axis
* ymin [=min(y)]: Minimal value of y-axis
* ymax [=max(y)]: Maximal value of y-axis
* dx [=0.]: Relative justification of pixels in x-direction. Used if 'x' is no grid.
* dy [=dx]: Relative justification of pixels in y-direction. Used if 'y' is no grid.
* fill [=20]: global filling method (see %.shade_region)
* fmap [=Integer_Type[n,m]+fill]: individual filling method for each pixel
%* nancol [="black"]: Extra color for IMG pixel values, which are NAN.
* ratio [=1]: Desired ratio of x and y-axis scale
* W [=14]: Plot width [cm]. 'ratio' is overwritten if W & H are given!
* H [=W/ratio]: Plot height [cm]. 'ratio' is overwritten if W & H are given!
* colorscale : If given an inlay colorscale is plotted using xfig_plot_colorscale
* format: Format for colormap axis ticlabels, see 'help xfig_plot.axis'
* just [=[.95,.05,-.5,.5]]: Position (world00) & relative justification
of the colorscale.
* scale [=[.33,.05]] : Relative size of the colorscale in respect to W & H.
* xlabel: Label of x-axis
* ylabel: Label of y-axis
* depth [=150]: xfig depth
##### Description
Other than the %plot_png function of the xfig_plot structure this function
aims to plot images with a (given) ARBITRARY x/y-grid in a correct way
(NOTE that .plot_png does not care for x/y values!). This also allows to
plot images with logarithmic scales without any problems! In addition
it is easy to plot gabbed images by just giving the x and y grid as bin_lo
and bin_hi.
ARGUMENTS
IMG:
In any case a IMaGe has to be given, which can arbitrary dimensions n and m
(it even can be 1-dimensional).
x, y:
x and y-grids are optional arguments but cannot be given individually.
If no grid is given the grids are set to the pixel number assuming a linear
grid! The grids can be Array_Types either of length n and m, respectively, in
which case the bin_lo and bin_hi is created by assuming a linear grid.
Otherwise their length must be n+1, m+1!
It is also possible that x and y are Struct_Types already containing the bin_lo
and bin_hi (it is only required that the bin_lo filed has 'lo' in its name and
the bin_hi field 'hi', respectively). In that last case it is also possible to
plot images with gabs!
xf:
Must be and xfig_plot structure. If given the image is plotted into xf and there
will be no return value. This way all automatic plot settings of this function will
be disregarded. Otherwise a new xfig_plot is created (qualifiers are
passed through).
##### Example
% Example 1: logscale
variable x = [PI:10\*PI:#100];
variable y = [PI:5\*PI:#80];
variable IMG = sin(x) # transpose(cos(y));
variable xf = xfig_plot_image( IMG, x\*180/PI, y\*180/PI;
padx=0.025, pady=0.025,
dx=-.5,
xlog, ylog,
fill=20
);
xf.render("/tmp/test.pdf");
% Example 2: image of Example 1 but with gaps
variable tmp = [[1:30],[35:65],[75:115]];
variable x = struct{ lo = tmp/11.5\*PI, hi = (tmp+1)/11.5\*PI };
tmp = [[1:40],[50:90]];
variable y = struct{ lo = tmp/18.\*PI, hi = (tmp+1)/18.\*PI };
variable IMG = sin(x.lo) # transpose(cos(y.lo));
variable xf = xfig_plot_image( IMG, x, y ; cmap="drywet");
xf.render("/tmp/test.pdf");
__See also__: xfig_plot_new, %.shade_region, xfig_plot_colormap
#### xfig_plot_ionization_structure
##### Synopsis
plots the ionization structure from an abundance file produced by xstar
##### Usage
```c
plot_ionization_structure(String_Type abundace_file, String_Type[] elements, String_Type ouput_file)
Qualifiers
- xpow: plot radius in units of 10^xpow (default: 10)
- xaxis: use 'logxi' or 'radius' to set the abscissa (default: radius)
- temp: add temperature panel
- press: add pressure panel
- xee: add electron fraction panel
- dens: add density panel
- athresh: only ionization states are plotted which exceed a certain threshold (default: 0.3)
- ion_states: string array of ionization states in roman numbers
- width: plot witdh
- height: plot height
All other qualifiers are passed to xfig_plot.plot()
Description
This function produces and xfig plot of the ion abundance structure of an xstar calculation. The input parameters are the xstar abundance FITS file, a string array of the elements of interest and an output file name.
Examples
xfig_plot_ionization_structure ("xout_abund1.fits", ["si", "FE", "Mg", "O"], "ion_abundance.pdf"; ion_states = ["iii", "v"], temp );
plots the ion abundance of the ionization states III and V for the elements Silicon, Iron, Magnesium and Oxygen and the temperature as a function of radius.
xfig_plot_model
Synopsis
plots the model which was loaded by "read_data_from_write_plot"
Usage
XFig_Plot_Type pl = xfig_plot_model(XFig_Plot_Type pl, Struct_Type dat)
Qualifiers
- color: specify the color
- width: line width
- depth: depth in plot
- hplot: make it a histogram plot
- pp: model is plotted twice (pulse profile)
See also: xfig_plot_data,read_data_from_write_plot,read_col,write_plot
xfig_plot_params
Synopsis
Returns a xfig-plot of the given parameter (value, limits, [conf, chi2])
Usage
Struct_Type xplot = xfig_plot_params( Struct_Type params1, params2, ... );
Qualifiers
- tmpdir[='/tmp/'] Directory for temporar files
- size[=[12,9]]: Dimension in cm of the (main) plot
- space[=.05*size[0]]: Space between parameter columns. Dimension in cm of the (main) plot
- xwidth[=.5]: Width of the parameter symbols (same units as x values).
- x: Alternative values for the x-axis (e.g., time in MJD)
- xlabel: Label for the alternative x-axis.
- connect: Connects the individual parameter values with a line.
- conf: Confidence level for the given parameters are plotted, if given. conf must be a Struct_Type[] with fields: the 'index' of the parameter and the corresponding confidence (absolut) limits 'conf_min' and 'conf_max'.
- steppar: Steppar information (see 'steppar'). Either steppar filename which is loaded with steppar_load or a List_Type with two elemtents 1. stepparinformation and 2. the keys.
- chi2log: Logarithmic scales for chi2 plots
- grid: Enables gridlines on the chi2 plots
- chi2max: Custom max value for chi2 range
- chi2min: Custom min value for chi2 range
- cmap[='ds9b']: Colormap for the colorcoded chi2 landscapes
- ticmap[='rainbow']: Colormap for the ticlabels/chi2 landscapes
Description
This function creates and returns a xfig-plot showing a compact overview of the given parameter information. The function takes a arbitrary number of arguments, which however are expected to be all parameter struct arrays (see get_params)! For each argument/parameter-array a individual xfig-plot will be created, which in the end will be combined in an xfig_new_vbox_combound spaced by 'space'.
The main plot shows the parameter values within its limits (y-axis). Its dimension are determined by the 'size' qualifier. By default the x-axis is either the parameter index or the number/dataset of the parameter, if the names of all given parameter are the same. The values are represented by horizontal lines, where their width can be specified by the 'xwidth' qualifier (measured in x units). If 'xwidth' exceeds the minimal distant of adjacent x-values, 'xwidth' is set to that value. The 'x' qualifier allows to use custom x-values, e.g., the time at which the parameters are valid. The corresponding label can be set with 'xlabel'. If the 'x' qualifier is used, a second x-axis will be added to the plot, which will be used to plot the parameter information, i.e., the spacing is given be those 'x' values! It is possible to give additional information about the parameters. Firstly the 'conf' qualifier can be used to give confidence levels of the parameters. 'conf' must be a Struct_Type[] with fields 'index' (index of the parameter), 'conf_min' and 'conf_max' corresponding to the absolut values of the confidence levels. The 'index' field is needed to find the corresponding parameter! Only matches will be plotted! Further information about the chi2 landscape can be given with the 'steppar' qualifier, which expect filename(s) or filepattern(s) to load steppar information produced with 'steppar'. The files are loaded using the 'steppar_load' function. Using 'steppar' qualifier creates a multiplot with two additional plots besides main plot (caution, the return xfig-plot will then be a xfit-multiplot!) showing the individual chi2 landscales of the parameters, if existent and a mean chi2 of those landscapes. With the 'chi2log' qualifier the chi2 landscapes are plotted logarithmic. 'grid' will extent the tics to a grid. To set custom limits for the chi2 range use 'chi2min' and 'chi2max'! To easily visualize which chi2 landscape belongs to which parameter, the parameter x-labels are colorized accordingly using the colormap given by 'ticmap'. Furthermore, color-coded chi2 landscapes are added to the main plot using the colormap given with 'cmap'. The colormaps can be given by either a name (String_Type) of an existing colormap (png_get_colormap_names) or a colormap itself.
See also: steppar, steppar_load, png_get_colormap_names }
xfig_plot_res
Synopsis
plots the residuals which were loaded by "read_data_from_write_plot"
Usage
XFig_Plot_Type pl = xfig_plot_model(XFig_Plot_Type pl, Struct_Type dat)
Qualifiers
- color: specify the color
- width: line width
- depth: depth in plot
- chi: specifies that the residuals are in chi
- ratio: specifies that the residuals are a ratio
- pp: residuals are plotted twice (pulse profile)
See also: xfig_plot_data,read_data_from_write_plot,read_col,write_plot
xfig_plot_spectrum
Synopsis
Makes an array of slxfig objects from a set of plots saved with write_plot
Usage
Struct_Type[] pl = xfig_plot_spectrum(Struct_Type plt[],[...])
Description
Generates an array of SLxfig plot objects from a given set of plot data structs (as generated by write_plot).
Arguments should be structs as returned by write_plot(;data). The first argument should be the "best-fit" model - i.e., the spectrum and model you want to plot in the top pane. Subsequent arguments should be structs returned by write_plot(;data) for "intermediate" residuals (e.g. with other spectral features turned on or off).
The function returns an array of SLxfig plot objects, which can then be rendered using, e.g., xfig_multiplot().render. The colors, symbols, linestyles, and other parameters can be adjusted using qualifiers (see below). Since the xfig objects themselves are returned, you can also modify them yourself after the fact (in order to, e.g., add labels or do more plotting).
EXAMPLE: consider a scenario where we fit some model containing a Gaussian emission line (using an "egauss" component) to a dataset of three spectra. We want to create a plot that has a top pane (occupying 50% of the total plot area) showing the spectrum and best-fit model, a middle pane showing the residuals without the emission line, and a bottom panel showing the best-fit residuals. The three spectra will be plotted in black, red, and blue, with the model overplotted in green, purple, and orange, and the output will be a PDF called "spectrum.pdf".
plot_data({1,2,3};res=1); % plot data and best-fit model with residuals
variable best = write_plot(;data); % write plot to a structure
set_par("egauss(1).area",0.0,1); % Turn off the emission line
() = fit_counts; % re-fit without the line
plot_data({1,2,3};res=1); % plot data without the line
variable noline = write_plot(;data); % write the last plot to another structure
pl = xfig_plot_spectrum(best,noline; % call xfig_plot_spectrum to create the xfig objects
colors=["black","red","blue"], % data colors
mcolors=["green","purple","orange"], % model colors
topPanelFrac=0.5); % top panel (data+model) occupies 50% of total plot area
xfig_multiplot(pl).render("spectrum.pdf");% render the final plot as a PDF
More qualifiers (see below) are available to fine-tune how the plot appears. The colors, style, and size modifiers (dsym, symsize, mstyle, mscale, dataDepth, modelDepth) can be given as arrays, with one element for each spectrum plotted, or as single values, in which case each spectrum is plotted with the same symbol/style/color/size.
By default, the x- and y-ranges for the resulting plot will depend on the energy (or wavelength) ranges which were noticed when you called write_plot(). The simplest way to change the range of the resulting plot is to only notice the wavelength/energy range you want to plot with xnotice() or xnotice_en() - this will ensure that the y-axis and residuals scale properly with what is plotted. There are also "xrange" and "yrange" qualifiers to set the range of the top panel; however, the residual ranges are still determined based on the full range of data.
Labels for the individual panels can be enabled via the "labels" qualifier. If labels is present, but not set (or if its first element is NULL), then the panels will be automatically labeled with letters starting from 'a'. The "firstPanelLabel" qualifier can be used to change the starting label; it should be a single letter. If the "labels" qualifier is not present at all, the panels will be unlabeled. The x/y positions of the labels can be set via the label_x and label_y qualifiers, which should be arrays of Double_Type values indicating the positions of the lower-right corners of the labels for each panel in 'world0' coordinates for that panel (see 'xfig_plot--wcs'). By default these are [0.94,0.90] for the data+model panel and [0.94,0.78] for the residuals.
The "gaps" qualifier lets you specify where the model should not be plotted
(e.g., between 1.7 and 2.4 keV in the Suzaku-XIS). It should be given as a
List_Type list of Array_Type arrays, one array for each spectrum plotted.
The arrays should be a list of start and stop energies for the gaps (this
means they need to have even length); for instruments with no gaps, pass
Double_Type[0]
. E.g., for a Suzaku observation with XIS0, XIS1,
XIS3, and the HXD/PIN where you don't want to plot the model between 1.6
and 2.3 keV in the XIS spectra, you would pass
gaps={[1.6,2.3],[1.6,2.3],[1.6,2.3],Double_Type[0]}
.
This script is mostly feature-complete, but please contact Paul Hemphill (pbh@space.mit.edu) regarding bugs or missing features (please do not report missing bugs; any bugs that are not present are missing intentionally).
Qualifiers
- topPanelFrac: Double_Type, fraction of plot taken up by top panel, default 0.5
- height: Double_Type, height of plot in cm, default 14.2
- width: Double_Type, width of plot in cm, default 12.6
- colors: String_Type[] or Integer_Type[], xfig colors for each spectrum plotted, by default uses get_sron_colors() to get a set of colors
- mcolors: String_Type[] or Integer_Type[], xfig colors for each model plotted. By default each model is plotted with the same color as its associated data.
- dsym: String_Type[] or Integer_Type[], xfig symbols for data for each spectrum plotted, defaults to "point"
- symsize: Integer_Type[], size of symbols for each spectrum plotted. Can be a single value or an array (one element for each spectrum).
- mstyle: Integer_Type[], xfig linestyle for overplotted best-fit model for each spectrum. mstyle = -1 plots the model as a histogram. As with symsize, can be single value or array. Default -1
- mwidth: Integer_Type[], xfig line width for overplotted best-fit model. As with symsize, can be single value or array. Default 1.
- mscale: Double_Type[], multiplicative scale for model (e.g., if you want to plot your model above your data points). Single value or array.
- dataDepth: Integer_Type[], xfig depth for data points, either a single value or an array specifying the depth for each spectrum. Default 1
- modelDepth: Integer_Type[], xfig depth for model lines. See dataDepth. Default 0 (this means models are plotted over data by default)
- ratio: If present, residuals are ratio residuals, otherwise residuals are assumed to be some variant of data-model.
- no_residuals: If set, no residuals are plotted.
- gaps: List_Type, indicates where gaps in an instrument's spectrum mean the model should not be plotted.
- xrange: Double_Type[2], range for x-axis (default autoscaled)
- yrange: Double_Type[2], range for y-axis of top panel (default autoscaled)
- rrange: List_Type[]. Should be a list of two-element arrays containing the minimum and maximum for the y-axis of each residual plot, in the order that they appear on the plot.
- xlog: Axes are linear by default. If "xlog" is set, or if it is set to a nonzero number, the x-axis will be logarithmic. If "xlog" is not set, or is set to zero, the x-axis will be linear.
- ylog: See xlog; sets log/linear scale for y-axis on top panel. Residual plots always have linear y-axes.
- unit: String_Type, either "keV" (energy, default) or "A" (wavelength).
- xlabel: String_Type, label for x-axis, default depends on units. If unit="keV", "Energy (keV)"; if unit="A", "Wavelength (\AA)". Set to NULL for no label.
- ylabel: String_Type, label for y-axis of spectrum, default depends on units. If unit="keV", "Counts s$^-1$ keV$^-1$"; if unit="A", "Counts s$^{-1}$ \AA$^{-1}$".
- rlabel: String_Type, label for y-axis of residuals. If the "ratio" qualifier is set, default is "Ratio", otherwise default is "$\chi$".
- labels: String_Type[], labels for individual panels.
- firstPanelLabel: String_Type or Integer_Type, label for first panel (further panels will increment this value, so if you give 'b' the next panels will be 'c', 'd', etc).
- label_x: Double_Type[], x-positions (in world0 coordinates) of panel labels.
- label_y: Double_Type[], y-positions (in world0 coordinates) of panel labels.
- arrowY: Double_Type[2], lower and upper device coordinates for arrows for bins extending off the screen, default [0.01,0.1].
- version: Display version information and exit.
See also: write_plot, xfig_multiplot, xfig_plot_unfold, xfig_plot--wcs
xfig_plot_unfold
Synopsis
tries to plot the complete plot loaded by "read_data_from_write_plot"
Usage
XFig_Plot_Type pl = xfig_plot_unfold(Struct_Type dat)
Qualifiers
- size: [dx,dy,dr] size of the xfig-plot
- dcol: color of the data
- mcol: color of the model
- xrng: [xmin,xmax]
- yrng: [ymin,ymax]
- rrng: [rmin,rmax]
- ranges: [xmin,xmax,ymin,ymax,rmin,rmax]
- chi: specifies that the residuals are chi
- ratio: specifies that the residuals are ratio
- y_label: set a y-label for the data/model plot
- keV2erg_fac: if given, the y-label is given in units of ergs/s/cm^2 x 10^keV2erg_fac
- pp: data is plotted twice (pulse profile)
Description
With "read_data_from_write_plot", previously stored data can be loaded into a structure. This structure ("dat" in the example above) can now be plotted with "xfig_plot_unfold".
The routines xfig_plot_data, xfig_plot_model, and xfig_plot_res do the single steps on its own.
See also: xfig_plot_data,xfig_plot_model,xfig_plot_res,read_data_from_write_plot,write_plot
xfig_polarplot_new
Synopsis
creates a xfig_plot with polar axis
Usage
Struct_Type xfig_plot_new( Double_Type Size )
or
```c
Struct_Type xfig_plot_new()
##### Qualifiers
* S [=10]: Size of quadratic plot in width and height [cm].
Is overwritten by argument size!
* min [=0]: Minimal angle of polar plot [degree]
* max [=180]: Maximal angle of polar plot [degree]
* origin [=90]: Origin of angular axis measured from x-axis [degree]
* dir [=-1]: Clockwise direction of polar plot axis (-1/1)
* ticlabels [=.6]: If 0 ticlabels are turned of. If not 0 it is used
as relative justification
* ticlabelsize [="small"]: Size of ticlabels
* ticlabelrotate [=1]: Rotate polar ticlabels corresponding to their position (0/1)
* ticthickness [=2]: Thickness of tics
* smallticinc [=2]: Increment for small tics [degree]
* medticinc [=10]: Increment for medium tics [degree]
* bigticinc [=20]: Increment for big tics [degrees]
* aticlables [=[min:max:bigticinc]]: Ticlabels of angular axis
* aticformat ["$%d^\circ$"]: Format for the angular ticlabels
* rlabel [=NULL]: Label for the radial axis
* rtics [=11]: Number of radial tics
* rticlabel [ =[0:1:#rtics/2] ]: Radial tic labels. The 0th rtic label will not be drawn!
* norticlabel If given, disabels radial tic labels.
* rticlabelrotate [=0]: Rotate polar ticlabels corresponding to their position (0/1)
* padr [=0.05]: Padding of radial axis
* grid : If given grid lines are plotted
* gridcolor [="#BBBBBB"]: Color of the grid lines
* debug If given the x-y-axis of the underlying xfig_plot are shown
##### Description
This function returns a xfig_plot_new structure but imprinted with polar axis.
This way one can use the functionality of xfig_plot_new. The polar axis
can be modified with the qualifiers above.
NOTE that when using %.(h)plot still requries 'x' and 'y' values, not 'radius'
and 'angle'. That means the user has to do the transformation manually accounting
for the 'origin', 'direction' and 'minimal'/'maximal' values (see examples).
TO BE IMPLEMENTED:
\* functionality to us 'radius' and 'angle' for plotting!
##### Example
% Plot coordinate transformation
variable min = 0,
max = 180,
dir = 1,
org = 45;
variable ang = [min:max:#100];
variable rad = 0.5+0.5\*sin(ang\*PI/180);
variable xf = xfig_polarplot_new(; min=min, max=max, origin=org, dir=dir, grid );
xf.plot( rad\*cos( dir\*(ang+org)\*PI/180 ),
rad\*sin( dir\*(ang+org)\*PI/180 ) ; color="red" );
xf.render("/tmp/test.pdf");
__See also__: xfig_plot_new
#### xylabel_in_box
##### Synopsis
places a text label at a relative position in the plot box
##### Usage
```c
xylabel_in_box(Double_Type x_rel, y_rel, String_Type label[, angle[, justify]]);
Description
xylabel_in_box
uses relative coordinates x_rel
and y_rel
:
the plot box corresponds to 0<=x_rel<=1
and 0<=y_rel<=1
,
but the label
can also be placed outside of this area.
In order to calculate the world coordinates (with coords_in_box
),
the x
- and yrange
has to be set before the first plot command.
The world coordinates and the optional parameters are passed to
xylabel
, so see xylabel
for a description of angle
and justify
.
See also: coords_in_box, xylabel
y1axis
Synopsis
(re)draws a first y-axis
Usage
y1axis(Double_Type min_value, Double_Type max_value[, Double_Type step]);
Qualifiers
- nsub [=0]: number of minor tick marks within each major divison (nsub=0 => no minor ticks)
- maji [=0.5]: length of major tick marks, drawn inwards (in units of the character height)
- majo [=0]: length of major tick marks, drawn outwards (in units of the character height)
- fmin [=0.5]: length of minor tick marks (as fraction of the major tick marks)
- disp [=0.5]: displacement of baseline of tick labels to the axis (in units of the character height)
- angle [=0]: orientation of the text (in degrees)
- color [=1]: color of the axis
- linewidth [=1]: line width of the axis
- opt [="N"/"LN"]: pgaxis-options: "L" (log), "N" (numbers), "1" (force decimal), "2" (force EE)
- xrel [=0]: relative position of the y1axis (0=left, 1=right)
- ymin [=ymin]: absolute y-position of the axis
- ymax [=ymax]: absolute y-position of the axis
See also: x2axis (and references therein)
y2axis
Synopsis
draws a second y-axis
Usage
y2axis(Double_Type min_value, Double_Type max_value[, Double_Type step]);
Qualifiers
- nsub [=0]: number of minor tick marks within each major divison (nsub=0 => no minor ticks)
- maji [=0.5]: length of major tick marks, drawn inwards (in units of the character height)
- majo [=0]: length of major tick marks, drawn outwards (in units of the character height)
- fmin [=0.5]: length of minor tick marks (as fraction of the major tick marks)
- disp [=0.5]: displacement of baseline of tick labels to the axis (in units of the character height)
- angle [=0]: orientation of the text (in degrees)
- color [=1]: color of the axis
- linewidth [=1]: line width of the axis
- opt [="N"/"LN"]: pgaxis-options: "L" (log), "N" (numbers), "1" (force decimal), "2" (force EE)
- xrel [=1]: relative position of the y2axis (0=left, 1=right)
- ymin [=ymin]: absolute y-position of the axis
- ymax [=ymax]: absolute y-position of the axis
See also: x2axis (and references therein)
y2label
Synopsis
labels the second y-axis
Usage
y2label(String_Type s);
Qualifiers
- color [=1]: textcolor
- f [=0.03]: fraction of the plot-area's width that the label is to the right
See also: xylabel