예제 #1
0
    for n in range(3):
        datum = [random() for j in range(n_components[i])]
        data.append(tuple(datum))
    dataset = graph.add_dataset(data, type=data_types[i])

    # customize dataset
    dataset.line.configure(type=0)
    dataset.symbol.configure(shape=SYMBOLS["Triangle up"], fill_color=i + 2)

# automatically space multi graph and automatically format figures.
# width_to_height_ratio specifies the frame dimensions, hgap and vgap
# specify the horizontal and vertical gap between frames, hoffset
# specifies the offset from the left and right side, and voffset
# specifies the offset from the top and bottom.
grace.automulti(width_to_height_ratio=1.0,
                hgap=0.02,
                vgap=0.02,
                hoffset=(0.03, 0.03),
                voffset=(0.03, 0.03))
grace.autoformat()

# hide all ticklabels and ticks
for graph in grace.graphs:
    graph.xaxis.tick.onoff = 'off'
    graph.xaxis.ticklabel.onoff = 'off'
    graph.yaxis.tick.onoff = 'off'
    graph.yaxis.ticklabel.onoff = 'off'

# print the grace (.agr format) to a file
grace.write_file('09_datasets.agr')
예제 #2
0
    graph.yaxis.ticklabel.configure(format="decimal",prec=1)

# automatically space multi graph and automatically format figures.
# width_to_height_ratio specifies the frame dimensions, hgap and vgap
# specify the horizontal and vertical gap between frames, hoffset
# specifies the offset from the left and right side, and voffset
# specifies the offset from the top and bottom.  
grace.automulti(width_to_height_ratio=1.0,hgap=0.05,vgap=0.05,
                hoffset=(0.1,0.05),voffset=(0.05,0.1))

# Grace.autoscale_same can be used to autoscale all graphs to have the
# same bounds.  Convenient, eh?
grace.autoscale_same()

# hide all of the interior labels to make this look v. nice
grace.hide_redundant_labels()

# add axis labels to matrix of figures
grace.set_row_xaxislabel(2,"x")
grace.set_col_yaxislabel(0,"y")

# Whoa there partner, those are some rather large ticks and labels you
# have there.  You can scale them down to look more appropriate with
# the GraceObject.scale_suffix method
grace.scale_suffix(0.5,"major_size")
grace.scale_suffix(0.5,"minor_size")
grace.scale_suffix(0.5,"char_size")

# print the grace (.agr format) to a file
grace.write_file('07_panels.agr')
예제 #3
0
# width_to_height_ratio specifies the frame dimensions, hgap and vgap
# specify the horizontal and vertical gap between frames, hoffset
# specifies the offset from the left and right side, and voffset
# specifies the offset from the top and bottom.
grace.automulti(width_to_height_ratio=1.0,
                hgap=0.05,
                vgap=0.05,
                hoffset=(0.1, 0.05),
                voffset=(0.05, 0.1))

# Grace.autoscale_same can be used to autoscale all graphs to have the
# same bounds.  Convenient, eh?
grace.autoscale_same()

# hide all of the interior labels to make this look v. nice
grace.hide_redundant_labels()

# add axis labels to matrix of figures
grace.set_row_xaxislabel(2, "x")
grace.set_col_yaxislabel(0, "y")

# Whoa there partner, those are some rather large ticks and labels you
# have there.  You can scale them down to look more appropriate with
# the GraceObject.scale_suffix method
grace.scale_suffix(0.5, "major_size")
grace.scale_suffix(0.5, "minor_size")
grace.scale_suffix(0.5, "char_size")

# print the grace (.agr format) to a file
grace.write_file('07_panels.agr')
예제 #4
0
    # add a simple DataSet as a "child" of the graph instance.  A list
    # of data is always the required first argument to add_dataset.
    data = []
    for n in range(3):
        datum = [random() for j in range(n_components[i])]
        data.append(tuple(datum))
    dataset = graph.add_dataset(data, type=data_types[i])

    # customize dataset
    dataset.line.configure(type=0)
    dataset.symbol.configure(shape=SYMBOLS["Triangle up"], fill_color=i + 2)

# automatically space multi graph and automatically format figures.
# width_to_height_ratio specifies the frame dimensions, hgap and vgap
# specify the horizontal and vertical gap between frames, hoffset
# specifies the offset from the left and right side, and voffset
# specifies the offset from the top and bottom.
grace.automulti(width_to_height_ratio=1.0, hgap=0.02, vgap=0.02, hoffset=(0.03, 0.03), voffset=(0.03, 0.03))
grace.autoformat()

# hide all ticklabels and ticks
for graph in grace.graphs:
    graph.xaxis.tick.onoff = "off"
    graph.xaxis.ticklabel.onoff = "off"
    graph.yaxis.tick.onoff = "off"
    graph.yaxis.ticklabel.onoff = "off"

# print the grace (.agr format) to a file
grace.write_file("09_datasets.agr")
예제 #5
0
    # of data is always the required first argument to add_dataset.
    data = []
    for n in range(3):
        datum = [random() for j in range(n_components[i])]
        data.append(tuple(datum))
    dataset = graph.add_dataset(data,type=data_types[i])

    # customize dataset
    dataset.line.configure(type=0)
    dataset.symbol.configure(shape=SYMBOLS["Triangle up"],
                             fill_color=i+2)

# automatically space multi graph and automatically format figures.
# width_to_height_ratio specifies the frame dimensions, hgap and vgap
# specify the horizontal and vertical gap between frames, hoffset
# specifies the offset from the left and right side, and voffset
# specifies the offset from the top and bottom.  
grace.automulti(width_to_height_ratio=1.0,hgap=0.02,vgap=0.02,
                hoffset=(0.03,0.03),voffset=(0.03,0.03))
grace.autoformat()

# hide all ticklabels and ticks
for graph in grace.graphs:
    graph.xaxis.tick.onoff = 'off'
    graph.xaxis.ticklabel.onoff = 'off'
    graph.yaxis.tick.onoff = 'off'
    graph.yaxis.ticklabel.onoff = 'off'

# print the grace (.agr format) to a file
grace.write_file('09_datasets.agr')