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')
# 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")
graph.panel_label.configure(placement="our",dx=0.01,dy=0.01) # add a simple DataSet as a "child" of the graph instance. A list # of data is always the required first argument to add_dataset. dataset = graph.add_dataset(data,ElCircleDataSet,1) # ticklabels graph.xaxis.ticklabel.configure(format="decimal",prec=1) 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
# add a simple DataSet as a "child" of the graph instance. A list # of data is always the required first argument to add_dataset. dataset = graph.add_dataset(data, ElCircleDataSet, 1) # ticklabels graph.xaxis.ticklabel.configure(format="decimal", prec=1) 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