Example #1
0
        w.plcol0(15)
        for i in range(16):
            w.plmtex("b", 1.5, ((i + 0.5) / 16.), 0.5, str(i))

        k = 0
        w.plmtex("t", 1.5, 0.5, 0.5, title)
        for i in range(16):

            # Write the digits to the left of the frame

            w.plmtex("lv", 1.0, (1.0 - (i + 0.5) / 16.), 1.0, str(16 * i))

            w.plsfont(family_index, style_index, weight_index)
            for j in range(16):
                x = (j + 0.5) / 16.
                y = 1. - (i + 0.5) / 16

                # Display the Type 1 glyph corresponding to k
                glyph_string = unichr(k).encode('utf-8')
                # Escape the escape.
                if glyph_string == "#":
                    glyph_string = "##"
                w.plptex(x, y, 1., 0., 0.5, glyph_string)
                k = k + 1
            w.plsfont(0, 0, 0)


main(w)
w.plend()
Example #2
0
"""

# set up some data to plot
from Numeric import *

x = arange(10, typecode=Float)
y = x**2

import plplot

plplot.plsdev("xwin")
plplot.plinit()
plplot.plenv(min(x), max(x), min(y), max(y), 0, 1)
plplot.pllab("x", "x**2", "Example 2D plot")
plplot.plline(x, y)
plplot.plend()

# to save as well, have to set everything up again, and replot
# save as png
plplot.plsdev("png")
plplot.plsfnam("simplePlotExample.png")
plplot.plinit()
plplot.plenv(min(x), max(x), min(y), max(y), 0, 1)
plplot.pllab("x", "x**2", "Example 2D plot")
plplot.plline(x, y)
plplot.plend()

# save as postscript
plplot.plsdev("psc")
plplot.plsfnam("simplePlotExample.ps")
plplot.plinit()
Example #3
0
 def cleanup(self):
     plplot.plend()
     plplot_pyqt4.plfreeqtdev()
Example #4
0
def plend():
    if PLPLOT:
        plg.plend()
    else:
        plg.pgend()