Ejemplo n.º 1
0
# Plots the first 256 unicode glyphs.
# N.B. If ps.c is edited to #define PL_TEST_TYPE1 (which interprets
# unicode in the range from 0 to 255 directly as Type1 font indices) and
# if the -dev ps -drvopt hrshsym=0 command-line options are used, then
# the results are similar to the results obtained from the historical
# gfontview application that is no longer available under Linux.

# Append to effective python path so that can find plplot modules.
from plplot_python_start import *

import sys
import plplot as w

# Parse and process command line arguments
w.plparseopts(sys.argv, w.PL_PARSE_FULL)

# Initialize plplot
w.plinit()

# main
#
# Displays all available Type1 glyphs.

family = (
    "sans-serif",
    "serif",
    "monospace",
    "script",
    "symbol",
)
Ejemplo n.º 2
0
WIDTH = 1000  # 500
HEIGHT = 600  # 300


# Delete event callback
def delete_event(widget, event, data=None):
    return gtk.FALSE


# Destroy event calback
def destroy(widget, data=None):
    gtk.main_quit()


# Parse the options
plplot.plparseopts(sys.argv, plplot.PL_PARSE_FULL)

# The data to plot
x = Numeric.arange(11)
y = x**2 / 10.

# Create the canvas and set its size; during the creation process,
# the gcw driver is loaded into plplot, and plinit() is invoked.
canvas = plplotcanvas.Canvas()
canvas.set_size(WIDTH, HEIGHT)

# Create a new window and stuff the canvas into it
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_border_width(10)
window.add(canvas)