Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ppgplot.pgslw(width)
# Choose the line color for the contourlines
if isstr(color):
ppgplot.pgsci(ppgplot_colors_[color])
else:
ppgplot.pgsci(color)
# Construct the contours
ppgplot.pgcont_s(z, len(contours), contours, rangex[0], \
rangey[0], rangex[1], rangey[1])
# Label the contours if requested
if labels is not None:
# Choose the line color for the contourlines
if isstr(labels):
ppgplot.pgsci(ppgplot_colors_[labels])
else:
ppgplot.pgsci(labels)
for i in range(len(contours)):
ppgplot.pgconl_s(z, contours[i], str(contours[i]),
labelint, labelmin)
ppgplot.pgctab(pgpalette.l,pgpalette.r,pgpalette.g,pgpalette.b)
# Construct the image
ppgplot.pgimag_s(z, 0.0, 0.0, rangex[0], rangey[0], \
rangex[1], rangey[1])
reset_colors()
if contours is not None:
contours = Num.asarray(contours)
# Choose the line style
ppgplot.pgsls(line)
# Choose the line width
ppgplot.pgslw(width)
# Choose the line color for the contourlines
if isstr(color):
ppgplot.pgsci(ppgplot_colors_[color])
else:
ppgplot.pgsci(color)
# Construct the contours
ppgplot.pgcont_s(z, len(contours), contours, rangex[0], \
rangey[0], rangex[1], rangey[1])
# Label the contours if requested
if labels is not None:
# Choose the line color for the contourlines
if isstr(labels):
ppgplot.pgsci(ppgplot_colors_[labels])
else:
ppgplot.pgsci(labels)
for i in range(len(contours)):
ppgplot.pgconl_s(z, contours[i], str(contours[i]),
labelint, labelmin)
if x is None: x=Num.arange(len(y), dtype='f')
else: x = Num.asarray(x)
# Determine the scaling to use for the first axis
if rangex is None: rangex=[x.min(), x.max()]
if rangey is None:
if noscale: rangey=[y.min(), y.max()]
else: rangey=scalerange(y)
# Prep the plotting device...
if (not ppgplot_dev_prep_ and setup):
prepplot(rangex, rangey, title, labx, laby, \
rangex2, rangey2, labx2, laby2, \
logx, logy, logx2, logy2, font, fontsize, \
id, aspect, ticks, panels, device=device)
# Choose the line color
if isstr(color):
ppgplot.pgsci(ppgplot_colors_[color])
else:
ppgplot.pgsci(color)
# Plot symbols (and errors) if requested
if not symbol is None:
ppgplot.pgpt(x, y, symbol)
# Error bars
if errx is not None:
if not logx:
errx = Num.asarray(errx)
ppgplot.pgerrx(x+errx, x-errx, y, 1.0)
else:
errx = 10.0**Num.asarray(errx)
ppgplot.pgerrx(Num.log10(10.0**x + errx),
Num.log10(10.0**x - errx), y, 1.0)
if erry is not None:
if not logy:
def resetdefaults():
"""
resetdefaults():
Reset global plotting variables to default values.
"""
global ppgplot_font_, ppgplot_linestyle_, ppgplot_linewidth_, \
ppgplot_color_, ppgplot_font_size_
ppgplot.pgscf(ppgplot_font_)
ppgplot.pgsls(ppgplot_linestyle_)
ppgplot.pgslw(ppgplot_linewidth_)
ppgplot.pgsci(ppgplot_colors_[ppgplot_color_])
ppgplot.pgsch(ppgplot_font_size_)
# Determine the scaling to use for the first axis
if rangex is None: rangex=[x.min(), x.max()]
if rangey is None:
if noscale: rangey=[y.min(), y.max()]
else: rangey=scalerange(y)
# Prep the plotting device...
if (not ppgplot_dev_prep_ and setup):
prepplot(rangex, rangey, title, labx, laby, \
rangex2, rangey2, labx2, laby2, \
logx, logy, logx2, logy2, font, fontsize, \
id, aspect, ticks, panels, device=device)
# Choose the line color
if isstr(color):
ppgplot.pgsci(ppgplot_colors_[color])
else:
ppgplot.pgsci(color)
# Plot symbols (and errors) if requested
if not symbol is None:
ppgplot.pgpt(x, y, symbol)
# Error bars
if errx is not None:
if not logx:
errx = Num.asarray(errx)
ppgplot.pgerrx(x+errx, x-errx, y, 1.0)
else:
errx = 10.0**Num.asarray(errx)
ppgplot.pgerrx(Num.log10(10.0**x + errx),
Num.log10(10.0**x - errx), y, 1.0)
if erry is not None:
if not logy:
erry = Num.asarray(erry)
ppgplot.pgerry(x, y+erry, y-erry, 1.0)
ppgplot.pgsls(line)
# Choose the line width
ppgplot.pgslw(width)
# Choose the line color for the contourlines
if isstr(color):
ppgplot.pgsci(ppgplot_colors_[color])
else:
ppgplot.pgsci(color)
# Construct the contours
ppgplot.pgcont_s(z, len(contours), contours, rangex[0], \
rangey[0], rangex[1], rangey[1])
# Label the contours if requested
if labels is not None:
# Choose the line color for the contourlines
if isstr(labels):
ppgplot.pgsci(ppgplot_colors_[labels])
else:
ppgplot.pgsci(labels)
for i in range(len(contours)):
ppgplot.pgconl_s(z, contours[i], str(contours[i]),
labelint, labelmin)