gr.pygr Reference

Python GR module

Exported Classes:

class gr.pygr.CoordConverter(sizex, sizey, window=None, scale=None)[source]
getNDC()[source]
getScale()[source]
getWC(viewport)[source]
getWindow()[source]
setNDC(x, y)[source]
setScale(scale)[source]
setWC(x, y, viewport, window=None)[source]
setWCforPlotAxes(x, y, axes)[source]
setWindow(xmin, xmax, ymin, ymax)[source]
property window
class gr.pygr.Coords2D(x, y, updatex_callback=None, updatey_callback=None)[source]
setUpdateXCallback(fp)[source]
setUpdateYCallback(fp)[source]
property x

Get the current list/ndarray of x values.

property y

Get the current list/ndarray of y values.

class gr.pygr.Coords2DList(*args, **kwargs)[source]
TYPE

alias of Coords2D

append(other)[source]

Append object to the end of the list.

extend(otheriter)[source]

Extend list by appending elements from the iterable.

insert(index, other)[source]

Insert object before index.

pop(*args, **kwargs)[source]

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(other)[source]

Remove first occurrence of value.

Raises ValueError if the value is not present.

updateMinMax(*coords, **kwargs)[source]
class gr.pygr.Coords3D(x, y, z)[source]
property z

Get the current list/ndarray of z values.

class gr.pygr.Coords3DList(*args, **kwargs)[source]
TYPE

alias of Coords3D

updateMinMax(*coords, **kwargs)[source]
class gr.pygr.DeviceCoordConverter(width, height, sizex=None, sizey=None, window=None, scale=None)[source]
getDC()[source]
setDC(x, y)[source]
class gr.pygr.ErrorBar(x, y, dneg, dpos=None, direction=1, linetype=1, markertype=-32, linecolor=1, markercolor=1, linewidth=1)[source]
HORIZONTAL = 0
VERTICAL = 1
property direction

Get ErrorBars direction.

property dneg

Get the current ndarray of absolute deviation in negative direction.

property dpos

Get the current ndarray of absolute deviation in positive direction.

drawGR()[source]
property x

Get the current list/ndarray of x values.

property y

Get the current list/ndarray of y values.

class gr.pygr.GridCoords3D(x, y, z, nx=None, ny=None)[source]
class gr.pygr.Plot(viewport=(0.1, 0.95, 0.1, 0.95))[source]
addAxes(*args, **kwargs)[source]
addROI(roi)[source]
property autoscale
drawGR()[source]
getAxes(idx=None)[source]
getROI(p0)[source]
isLegendEnabled()[source]
logXinDomain()[source]
logYinDomain()[source]
property offsetXLabel

get NDC Y offset for xlabel

property offsetYLabel

get NDC X offset for ylabel

pan(dp, width, height)[source]
pick(p0, width, height)[source]
reset()[source]
select(p0, p1, width, height)[source]
setGrid(bool)[source]
setLegend(bool)[source]
setLegendWidth(width)[source]
setLogX(bool, rescale=False)[source]
setLogY(bool, rescale=False)[source]
property sizex

property sizey

property subTitle

get plot subtitle

property title

get plot title

property viewport

get current viewport

property xlabel

get label for x axis

property ylabel

get label for y axis

zoom(dpercent, p0=None, width=None, height=None)[source]
class gr.pygr.PlotAxes(viewport, xtick=None, ytick=None, majorx=None, majory=None, drawX=True, drawY=True, ticksize=0.01)[source]
COORDLIST_CLASS

alias of Coords2DList

COUNT = 0
OPTION = {1: 1, 2: 2}
SCALE_X = 1
SCALE_Y = 2
addCurves(*args, **kwargs)[source]
property autoscale
property backgroundColor
curveDataChanged(curve)[source]
curveVisibilityChanged(curve, flag)[source]
doAutoScale(curvechanged=None)[source]
drawGR()[source]
getBoundingBox()[source]
getCurves()[source]
getId()[source]
getVisibleCurves()[source]
getWindow()[source]
isGridEnabled()[source]
isReset()[source]
isXDrawingEnabled()[source]
isXLogDomain()[source]
isYDrawingEnabled()[source]
isYLogDomain()[source]
property majorx

get current user-defined number of minor tick intervals between major x tick marks

property majory

get current user-defined number of minor tick intervals between major y tick marks

plot(*args, **kwargs)[source]
reset()[source]
property scale
scaleWindow(xmin, xmax, xtick, ymin, ymax, ytick)[source]
setGrid(bool)[source]
setLogX(bool)[source]
setLogY(bool)[source]
setWindow(xmin, xmax, ymin, ymax)[source]
setXDrawing(bool)[source]
setXtickCallback(fp)[source]
setYDrawing(bool)[source]
setYtickCallback(fp)[source]
property ticksize

get current ticksize setting specified in normalized device coordinate unit.

property xtick

get current user-defined interval between minor x ticks

property ytick

get current user-defined interval between minor y ticks

class gr.pygr.PlotContour(x, y, z, h=None, majorh=0, nx=None, ny=None)[source]
drawGR()[source]
property h

Get the current list/ndarray of z values for the height.

property majorh

Get the interval of labeled contour lines majorh. A value of 1 will label every line. A value of 2 every second line and so on. A value of 0 disables labeling

class gr.pygr.PlotCurve(x, y, errBar1=None, errBar2=None, linetype=1, markertype=1, linecolor=None, markercolor=1, legend=None, linewidth=1)[source]
COUNT = 0
drawGR()[source]
property errorBar1

Get current ErrorBar #1 instance.

property errorBar2

Get current ErrorBar #2 instance.

property legend

Get current text for a legend.

class gr.pygr.PlotSurface(x, y, z, colormap=1, option=5, nx=None, ny=None)[source]
property colormap

Get the current colormap.

drawGR()[source]
property option

Get current surface display option.

class gr.pygr.Point(x, y)[source]
norm()[source]

Calculate euclidean norm.

property x

Get the current x value.

property y

Get the current y value.

class gr.pygr.RegionOfInterest(*args, **kwargs)[source]
LEGEND = 1
TEXT = 2
append(*args)[source]
isPointInside(p0)[source]
property reference

Get the current reference.

property regionType

Get the current regionType.

property x

Get the current x values.

property y

Get the current y values.

class gr.pygr.Text(x, y, text, axes=None, charheight=0.027, charup=(0, 1), halign=1, valign=1, textcolor=1, font=None, precision=None, textpath=0, charexpan=1.0, hideviewport=True)[source]
DEFAULT_CHARHEIGHT_FACTOR = 0.027
property charexpan

Return the current character expansion factor (width to height ratio).

property charheight

Return the current charheight factor.

property charup

Return the current charup vector (ux, uy).

drawGR()[source]
getBoundingBox()[source]
property halign

Return the horizontal alignment.

property hideviewport

Return the current hide outside viewport state.

setFont(font, precision=0)[source]

Set the font and the precision of the text representation.

property text

Return the current text string.

property textcolor

Return the color index for the text color.

property textpath

Return the current text path (direction in which text will be drawn).

property valign

Return the vertical alignment.

gr.pygr.delay(seconds)[source]
gr.pygr.isinstanceof(other, cls)[source]
gr.pygr.islistof(otheriter, cls)[source]
gr.pygr.ndctowc(x, y)[source]
gr.pygr.readfile(path, separator='')[source]
gr.pygr.wctondc(x, y)[source]