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]
window
class gr.pygr.Coords2D(x, y, updatex_callback=None, updatey_callback=None)[source]
setUpdateXCallback(fp)[source]
setUpdateYCallback(fp)[source]
x

Get the current list/ndarray of x values.

y

Get the current list/ndarray of y values.

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

alias of Coords2D

append(other)[source]
extend(otheriter)[source]
insert(index, other)[source]
pop(*args, **kwargs)[source]
remove(other)[source]
updateMinMax(*coords, **kwargs)[source]
class gr.pygr.Coords3D(x, y, z)[source]
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
direction

Get ErrorBars direction.

dneg

Get the current ndarray of absolute deviation in negative direction.

dpos

Get the current ndarray of absolute deviation in positive direction.

drawGR()[source]
x

Get the current list/ndarray of x values.

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]
autoscale
drawGR()[source]
getAxes(idx=None)[source]
getROI(p0)[source]
isLegendEnabled()[source]
logXinDomain()[source]
logYinDomain()[source]
offsetXLabel

get NDC Y offset for xlabel

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]
sizex

sizey

subTitle

get plot subtitle

title

get plot title

viewport

get current viewport

xlabel

get label for x axis

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)[source]
COORDLIST_CLASS

alias of Coords2DList

COUNT = 0
OPTION = {1: 1, 2: 2}
SCALE_X = 1
SCALE_Y = 2
addCurves(*args, **kwargs)[source]
autoscale
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]
majorx

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

majory

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

plot(*args, **kwargs)[source]
reset()[source]
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]
xtick

get current user-defined interval between minor x ticks

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]
h

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

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]
errorBar1

Get current ErrorBar #1 instance.

errorBar2

Get current ErrorBar #2 instance.

legend

Get current text for a legend.

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

Get the current colormap.

drawGR()[source]
option

Get current surface display option.

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

Calculate euclidean norm.

x

Get the current x value.

y

Get the current y value.

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

Get the current reference.

regionType

Get the current regionType.

x

Get the current x values.

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
charexpan

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

charheight

Return the current charheight factor.

charup

Return the current charup vector (ux, uy).

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

Return the horizontal alignment.

hideviewport

Return the current hide outside viewport state.

setFont(font, precision=0)[source]

Set the font and the precision of the text representation.

text

Return the current text string.

textcolor

Return the color index for the text color.

textpath

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

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]