Main Page | Class List | Directories | File List | Class Members | File Members

ObitPlot.h File Reference

ObitPlot Obit graphics class definition. More...

#include "Obit.h"
#include "ObitErr.h"
#include "ObitThread.h"
#include "ObitInfoList.h"
#include "ObitImage.h"

Go to the source code of this file.

Classes

struct  ObitPlot
 ObitPlot Class structure. More...
struct  ObitPlotClassInfo
 ClassInfo Structure. More...

Defines

#define ObitPlotUnref(in)   ObitUnref (in)
 Macro to unreference (and possibly destroy) an ObitPlot returns a ObitPlot* (NULL).
#define ObitPlotRef(in)   ObitRef (in)
 Macro to reference (update reference count) an ObitPlot.
#define ObitPlotIsA(in)   ObitIsA (in, ObitPlotGetClass())
 Macro to determine if an object is the member of this or a derived class.

Functions

void ObitPlotClassInit (void)
 Public: Class initializer.
ObitPlotnewObitPlot (gchar *name)
 Public: Constructor.
void ObitPlotInitPlot (ObitPlot *in, char *output, ObitErr *err)
 Public: Initialize plot.
void ObitPlotFinishPlot (ObitPlot *in, ObitErr *err)
 Public: Finalize plot.
ObitPlotObitPlotCopy (ObitPlot *in, ObitPlot *out, ObitErr *err)
 Public: Copy Plot.
gconstpointer ObitPlotGetClass (void)
 Public: Return class pointer.
void ObitPlotXYPlot (ObitPlot *in, gint symbol, gint n, gfloat *x, gfloat *y, ObitErr *err)
 Public: Simple X-Y plot.
void ObitPlotXYOver (ObitPlot *in, gint symbol, gint n, gfloat *x, gfloat *y, ObitErr *err)
 Public: Simple X-Y over plot.
void ObitPlotXYErr (ObitPlot *in, gint symbol, gint n, gfloat *x, gfloat *y, gfloat *e, ObitErr *err)
 Public: X-Y plot with error bars.
void ObitPlotContour (ObitPlot *in, gchar *label, ObitImage *image, gfloat lev, gfloat cntfac, ObitErr *err)
 Public: Contour plot.
void ObitPlotMarkCross (ObitPlot *in, ObitImage *image, gint n, gdouble *ra, gdouble *dec, gfloat size, ObitErr *err)
 Public: Mark positions on Contour plot.
void ObitPlotCpgenv (ObitPlot *in, gfloat xmin, gfloat xmax, gfloat ymin, gfloat ymax, gint just, gint axis, ObitErr *err)
 Public: set window and viewport and draw labeled frame.
void ObitPlotCpglab (ObitPlot *in, gchar *xlabel, gchar *ylabel, gchar *title, ObitErr *err)
 Public: write labels for x-axis, y-axis, and top of plot.
void ObitPlotCpgbox (ObitPlot *in, gchar *xopt, gfloat xtick, gint nxsub, gchar *yopt, gfloat ytick, gint nysub, ObitErr *err)
 Public: draw labeled frame around viewport.
void ObitPlotCpgsch (ObitPlot *in, gfloat cscale, ObitErr *err)
 Public: Scaling for characters.
void ObitPlotCpgslw (ObitPlot *in, gint lwidth, ObitErr *err)
 Public: Set line width.
void ObitPlotCpgmtxt (ObitPlot *in, gchar *side, gfloat disp, gfloat coord, gfloat fjust, gchar *text, ObitErr *err)
 Public: Write text.
void ObitPlotCpgmove (ObitPlot *in, gfloat x, gfloat y, ObitErr *err)
 Public: Front end to pgplot routine cpgmove.
void ObitPlotCpgdraw (ObitPlot *in, gfloat x, gfloat y, ObitErr *err)
 Public: Front end to pgplot routine cpgdraw.


Detailed Description

ObitPlot Obit graphics class definition.

This class is derived from the Obit class.

This contains information about the observations and the size and structure of the data.

Usage

Instances can be obtained using the newObitPlot constructor the ObitPlotCopy copy constructor or a pointer duplicated using the ObitPlotRef function. When an instance is no longer needed, use the ObitPlotUnref macro to release it.

Define Documentation

#define ObitPlotIsA in   )     ObitIsA (in, ObitPlotGetClass())
 

Macro to determine if an object is the member of this or a derived class.

Returns TRUE if a member, else FALSE in = object to reference

#define ObitPlotRef in   )     ObitRef (in)
 

Macro to reference (update reference count) an ObitPlot.

returns a ObitPlot*. in = object to reference

#define ObitPlotUnref in   )     ObitUnref (in)
 

Macro to unreference (and possibly destroy) an ObitPlot returns a ObitPlot* (NULL).

  • in = object to unreference.


Function Documentation

ObitPlot* newObitPlot gchar *  name  ) 
 

Public: Constructor.

Returns:
pointer to object created.

void ObitPlotClassInit void   ) 
 

Public: Class initializer.

void ObitPlotContour ObitPlot in,
gchar *  label,
ObitImage image,
gfloat  lev,
gfloat  cntfac,
ObitErr err
 

Public: Contour plot.

Parameters:
in Pointer to existing ObitPlot object.
label Label for plot
image Image to plot (first plane in BLC,TRC) Rotated images aren't done quite right
lev basic contour level (def 0.1 peak)
cntfac Contour level factor (def sqrt(2)
err ObitErr error stack
Optional parameters on in->info
  • CSIZE (int) Scaling factor for characters(default = 1)
  • LWIDTH (int) Line width (default = 1)

ObitPlot* ObitPlotCopy ObitPlot in,
ObitPlot out,
ObitErr err
 

Public: Copy Plot.

Parameters:
in Pointer to object to be copied.
out Pointer to object to be written. If NULL then a new structure is created.
err ObitErr error stack
Returns:
Pointer to new object.

void ObitPlotCpgbox ObitPlot in,
gchar *  xopt,
gfloat  xtick,
gint  nxsub,
gchar *  yopt,
gfloat  ytick,
gint  nysub,
ObitErr err
 

Public: draw labeled frame around viewport.

Draw labeled frame around viewport. Annotate the viewport with frame, axes, numeric labels, etc. PGBOX is called by on the user's behalf by PGENV, but may also be called explicitly.

Parameters:
in Pointer to Plot object.
xopt string of options for X (horizontal) axis of plot. Options are single letters, and may be in any order (see below).
xtick world coordinate interval between major tick marks on X axis. If XTICK=0.0, the interval is chosen by PGBOX, so that there will be at least 3 major tick marks along the axis.
nxsub the number of subintervals to divide the major coordinate interval into. If XTICK=0.0 or NXSUB=0, the number is chosen by PGBOX.
yopt string of options for Y (vertical) axis of plot. Coding is the same as for xopt.
ytick like xtick for the Y axis.
nysub like nxsub for the Y axis
err ObitErr error stack
Axis options:
  • A : draw Axis (X axis is horizontal line Y=0, Y axis is vertical line X=0).
  • B : draw bottom (X) or left (Y) edge of frame.
  • C : draw top (X) or right (Y) edge of frame.
  • G : draw Grid of vertical (X) or horizontal (Y) lines
  • I : Invert the tick marks; ie draw them outside the viewport instead of inside.
  • L : label axis Logarithmically
  • N : write Numeric labels in the conventional location below the viewport (X) or to the left of the viewport (Y).
  • P : extend ("Project") major tick marks outside the box (ignored if option I is specified)
  • M : write numeric labels in the unconventional location above the viewport (X) or to the right of the viewport (Y).
  • T : draw major Tick marks at the major coordinate interval.
  • S : draw minor tick marks (Subticks).
  • V : orient numeric labels Vertically. This is only applicable to Y. The default is to write Y-labels parallel to the axis.
  • 1 : force decimal labelling, instead of automatic choice (see PGNUMB).
  • 2 : force exponential labelling, instead of automatic.

void ObitPlotCpgdraw ObitPlot in,
gfloat  x,
gfloat  y,
ObitErr err
 

Public: Front end to pgplot routine cpgdraw.

The line is clipped at the edge of the current window. The new pen position is (X,Y) in world coordinates.

Parameters:
in Pointer to Plot object.
x (input): world x-coordinate of the end point of the line.
y (input): world y-coordinate of the end point of the line.
err ObitErr error stack

void ObitPlotCpgenv ObitPlot in,
gfloat  xmin,
gfloat  xmax,
gfloat  ymin,
gfloat  ymax,
gint  just,
gint  axis,
ObitErr err
 

Public: set window and viewport and draw labeled frame.

Set window and viewport and draw labeled frame Set PGPLOT "Plotter Environment". PGENV establishes the scaling for subsequent calls to PGPT, PGLINE, etc. The plotter is advanced to a new page or panel, clearing the screen if necessary. If the "prompt state" is ON (see PGASK), confirmation is requested from the user before clearing the screen. If requested, a box, axes, labels, etc. are drawn according to the setting of argument AXIS.

Parameters:
in Pointer to Plot object.
xmin the world x-coordinate at the bottom left corner of the viewport.
xmax the world x-coordinate at the top right corner of the viewport (note XMAX may be less than XMIN).
ymin the world y-coordinate at the bottom left corner of the viewport.
ymax the world y-coordinate at the top right corner of the viewport (note YMAX may be less than YMIN)
just if JUST=1, the scales of the x and y axes (in world coordinates per inch) will be equal, otherwise they will be scaled independently.
axis controls the plotting of axes, tick marks, etc:
  • axis = -2 : draw no box, axes or labels;
  • axis = -1 : draw box only;
  • axis = 0 : draw box and label it with coordinates;
  • axis = 1 : same as axis=0, but also draw the coordinate axes (X=0, Y=0);
  • axis = 2 : same as axis=1, but also draw grid lines at major increments of the coordinates;
  • axis = 10 : draw box and label X-axis logarithmically;
  • axis = 20 : draw box and label Y-axis logarithmically;
  • axis = 30 : draw box and label both axes logarithmically.
err ObitErr error stack

void ObitPlotCpglab ObitPlot in,
gchar *  xlabel,
gchar *  ylabel,
gchar *  title,
ObitErr err
 

Public: write labels for x-axis, y-axis, and top of plot.

write labels for x-axis, y-axis, and top of plot Write labels outside the viewport. This routine is a simple interface to PGMTXT, which should be used if PGLAB is inadequate.

Parameters:
in Pointer to Plot object.
xlabel a label for the x-axis (centered below the viewport).
ylabel a label for the y-axis (centered to the left of the viewport, drawn vertically)
title a label for the entire plot (centered above the viewport)
err ObitErr error stack

void ObitPlotCpgmove ObitPlot in,
gfloat  x,
gfloat  y,
ObitErr err
 

Public: Front end to pgplot routine cpgmove.

No line is drawn.

Parameters:
in Pointer to Plot object.
x (input) : world x-coordinate of the new pen position.
y (input) : world y-coordinate of the new pen position.
err ObitErr error stack

void ObitPlotCpgmtxt ObitPlot in,
gchar *  side,
gfloat  disp,
gfloat  coord,
gfloat  fjust,
gchar *  text,
ObitErr err
 

Public: Write text.

Write text at a position specified relative to the viewport (outside or inside). This routine is useful for annotating graphs. It is used by routine PGLAB. The text is written using the current values of attributes color-index, line-width, character-height, and character-font.

Parameters:
in Pointer to Plot object.
side Must include one of the characters 'B', 'L', 'T', or 'R' signifying the Bottom, Left, Top, or Right margin of the viewport. If it includes 'LV' or 'RV', the string is written perpendicular to the frame rather than parallel to it.
disp The displacement of the character string from the specified edge of the viewport, measured outwards from the viewport in units of the character height. Use a negative value to write inside the viewport, a positive value to write outside.
coord The location of the character string along the specified edge of the viewport, as a fraction of the length of the edge.
fjust Controls justification of the string parallel to the specified edge of the viewport. If FJUST = 0.0, the left-hand end of the string will be placed at COORD; if JUST = 0.5, the center of the string will be placed at COORD; if JUST = 1.0, the right-hand end of the string will be placed at at COORD. Other values between 0 and 1 give inter- mediate placing, but they are not very useful.
text The text string to be plotted. Trailing spaces are ignored when justifying the string, but leading spaces are significant.
err ObitErr error stack

void ObitPlotCpgsch ObitPlot in,
gfloat  cscale,
ObitErr err
 

Public: Scaling for characters.

Scaling for characters Set the character size attribute. The size affects all text and graph markers drawn later in the program. The default character size is 1.0, corresponding to a character height about 1/40 the height of the view surface. Changing the character size also scales the length of tick marks drawn by PGBOX and terminals drawn by PGERRX and PGERRY.

Parameters:
in Pointer to Plot object.
cscale new character size (dimensionless multiple of the default size).
err ObitErr error stack

void ObitPlotCpgslw ObitPlot in,
gint  lwidth,
ObitErr err
 

Public: Set line width.

This attribute affects lines, graph markers, and text. The line width is specified in units of 1/200 (0.005) inch (about 0.13 mm) and must be an integer in the range 1-201. On some devices, thick lines are generated by tracing each line with multiple strokes offset in the direction perpendicular to the line.

Parameters:
in Pointer to Plot object.
lwidth Width of line, in units of 0.005 inch (0.13 mm) in range 1-201.
err ObitErr error stack

void ObitPlotFinishPlot ObitPlot in,
ObitErr err
 

Public: Finalize plot.

Parameters:
in Pointer to Plot object.
err ObitErr error stack, return if existing error

gconstpointer ObitPlotGetClass void   ) 
 

Public: Return class pointer.

Initializes class if needed on first call.

Returns:
pointer to the class structure.

void ObitPlotInitPlot ObitPlot in,
char *  output,
ObitErr err
 

Public: Initialize plot.

void ObitPlotMarkCross ObitPlot in,
ObitImage image,
gint  n,
gdouble *  ra,
gdouble *  dec,
gfloat  size,
ObitErr err
 

Public: Mark positions on Contour plot.

Parameters:
in Pointer to existing ObitPlot object.
image Image plotted Descriptor assumed valid
n number of positions to plot
ra RAs (deg) to plot
dec Declinations to plot
size size of symbol in pixels
err ObitErr error stack
Optional parameters on in->info
  • CSIZE (int) Scaling factor for characters(default = 1)
  • LWIDTH (int) Line width (default = 1)

void ObitPlotXYErr ObitPlot in,
gint  symbol,
gint  n,
gfloat *  x,
gfloat *  y,
gfloat *  e,
ObitErr err
 

Public: X-Y plot with error bars.

Parameters:
in Pointer to Plot object.
symbol Symbol index to use for plotting (pgplot) values in the range [1,31] are usable if negative, use abs value and connect points
  • 1 = dot
  • 2 = plus
  • 3 = *
  • 4 = open circle
  • 5 = x
  • 6 = open square
  • 7 = open triangle
  • 12 = open star
  • 13 = filled triangle
  • 16 = filled square
  • 17 = filled circle
  • 18 = filled star
n Number of data points in x, y
x Independent variable, if NULL use index
y Dependent variable
e if nonNULL, error in y
err ObitErr error stack
Optional parameters on in->info
  • XMAX (float) maximum X value (defaults to actual value)
  • XMIN (float) minimum X value (defaults to actual value)
  • YMAX (float) maximum Y value (defaults to actual value)
  • YMIN (float) minimum Y value (defaults to actual value)
  • TITLE (string) Label for the plot (defaults to none), max 120
  • XLABEL (string) Label for horizontal axis (defaults to none)
  • XOPT (string) Options for horizontal axis (default "BCNTS") See ObitPlotCpgbox for details.
  • YLABEL (string) Label for vertical axis (defaults to none)
  • YOPT (string) Options for vertical axis (default "BCNTS") See ObitPlotCpgbox for details.
  • CSIZE (int) Scaling factor for characters(default = 1)
  • LWIDTH (int) Line width (default = 1)

void ObitPlotXYOver ObitPlot in,
gint  symbol,
gint  n,
gfloat *  x,
gfloat *  y,
ObitErr err
 

Public: Simple X-Y over plot.

Parameters:
in Pointer to Plot object.
symbol Symbol index to use for plotting (pgplot) values in the range [1,31] are usable if negative, use abs value and connect points
  • 1 = dot
  • 2 = plus
  • 3 = *
  • 4 = open circle
  • 5 = x
  • 6 = open square
  • 7 = open triangle
  • 12 = open star
  • 13 = filled triangle
  • 16 = filled square
  • 17 = filled circle
  • 18 = filled star
n Number of data points in x, y
x Independent variable, if NULL use index
y Dependent variable
e if nonNULL, error in y
err ObitErr error stack
Optional parameters on in->info
  • CSIZE (int) Scaling factor for characters(default = 1)
  • LWIDTH (int) Line width (default = 1)

void ObitPlotXYPlot ObitPlot in,
gint  symbol,
gint  n,
gfloat *  x,
gfloat *  y,
ObitErr err
 

Public: Simple X-Y plot.

Plot should be initialized with ObitPlotInitPlot before calling. Plot should be finalized with ObitPlotFinishPlot after all drawing on the current frame is finished. This routine draws the frame and adds labels, to only overplot data on the same frame, use ObitPlotXYOver

Parameters:
in Pointer to Plot object.
symbol Symbol index to use for plotting (pgplot) values in the range [1,31] are usable if negative, use abs value and connect points
  • 1 = dot
  • 2 = plus
  • 3 = *
  • 4 = open circle
  • 5 = x
  • 6 = open square
  • 7 = open triangle
  • 12 = open star
  • 13 = filled triangle
  • 16 = filled square
  • 17 = filled circle
  • 18 = filled star
n Number of data points in x, y
x Independent variable, if NULL use index
y Dependent variable
err ObitErr error stack
Optional parameters on in->info
  • XMAX (float) maximum X value (defaults to actual value)
  • XMIN (float) minimum X value (defaults to actual value)
  • YMAX (float) maximum Y value (defaults to actual value)
  • YMIN (float) minimum Y value (defaults to actual value)
  • TITLE (string) Label for the plot (defaults to none), max 120
  • XLABEL (string) Label for horizontal axis (defaults to none)
  • XOPT (string) Options for horizontal axis (default "BCNTS") See ObitPlotCpgbox for details.
  • YLABEL (string) Label for vertical axis (defaults to none)
  • YOPT (string) Options for vertical axis (default "BCNTS") See ObitPlotCpgbox for details.
  • CSIZE (int) Scaling factor for characters(default = 1)
  • LWIDTH (int) Line width (default = 1)
  • JUST (int) If !=0 then force X and Y axis scaling to be the same


Generated on Fri Aug 31 22:13:07 2007 for Obit by  doxygen 1.3.9.1