コード例 #1
0
# all of the data set types
data_types = [
    'xy', 'xydx', 'xydy', 'xydxdy', 'xydydy', 'xydxdx', 'xydxdxdydy', 'bar',
    'bardy', 'bardydy', 'xyhilo', 'xyz', 'xysize', 'xycolor', 'xyvmap',
    'xyboxplot'
]
n_components = [2, 3, 3, 4, 4, 4, 6, 2, 3, 4, 5, 3, 3, 3, 4, 6]

from random import random, randint

# make an instance of the Grace class that uses RandomColorScheme
seed = randint(0, 10000)
colors = RandomColorScheme(seed, len(data_types))
# colors = MarkovChainColorScheme(seed,len(data_types))
grace = MultiPanelGrace(colors=colors)

# specify the label scheme
grace.add_label_scheme("my_scheme", data_types)
grace.set_label_scheme("my_scheme")

# add a Graph as a "child" of the grace instance
for i in range(len(data_types)):
    graph = grace.add_graph(Panel)

    # customize the panel label scheme
    graph.panel_label.configure(dx=0.02, dy=0.02, placement="iul")

    # 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 = []
コード例 #2
0
ファイル: 07_panels.py プロジェクト: bjmorgan/pygrace
from PyGrace.Extensions.panel import Panel, MultiPanelGrace
from PyGrace.Styles.el import ElCircleDataSet
from PyGrace.Styles.journals import NaturePanelLabel

import example_tools
dataList = example_tools.panels()

# This example illustrates some features that exist for multigraphs,
# including methods which hide redundant labels on axes.  This also
# illustrates the use of panels which automatically come with a panel
# label.

# make an instance of the Grace class
grace = MultiPanelGrace()

# add a Graph as a "child" of the grace instance
for data in dataList:
    graph = grace.add_graph(Panel)

    # configure placement of panel label
    graph.panel_label.copy_format(NaturePanelLabel)

    # configure placement of panel label
    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)
コード例 #3
0
ファイル: 09_datasets.py プロジェクト: deanmalmgren/templates
    "xyhilo",
    "xyz",
    "xysize",
    "xycolor",
    "xyvmap",
    "xyboxplot",
]
n_components = [2, 3, 3, 4, 4, 4, 6, 2, 3, 4, 5, 3, 3, 3, 4, 6]

from random import random, randint

# make an instance of the Grace class that uses RandomColorScheme
seed = randint(0, 10000)
colors = RandomColorScheme(seed, len(data_types))
# colors = MarkovChainColorScheme(seed,len(data_types))
grace = MultiPanelGrace(colors=colors)

# specify the label scheme
grace.add_label_scheme("my_scheme", data_types)
grace.set_label_scheme("my_scheme")

# add a Graph as a "child" of the grace instance
for i in range(len(data_types)):
    graph = grace.add_graph(Panel)

    # customize the panel label scheme
    graph.panel_label.configure(dx=0.02, dy=0.02, placement="iul")

    # 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 = []
コード例 #4
0
from PyGrace.Extensions.panel import Panel, MultiPanelGrace
from PyGrace.Styles.el import ElCircleDataSet
from PyGrace.Styles.journals import NaturePanelLabel

import example_tools
dataList = example_tools.panels()

# This example illustrates some features that exist for multigraphs,
# including methods which hide redundant labels on axes.  This also
# illustrates the use of panels which automatically come with a panel
# label.

# make an instance of the Grace class
grace = MultiPanelGrace()

# add a Graph as a "child" of the grace instance
for data in dataList:
    graph = grace.add_graph(Panel)

    # configure placement of panel label
    graph.panel_label.copy_format(NaturePanelLabel)

    # configure placement of panel label
    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)
コード例 #5
0
# The resulting individual postscript files are eventually concatenated into
# one large file; this simply generates one file per page.

def make_output_for (grace, panel):
#    for g in grace.graphs:
#    	g.world.ymax = 500
    grace.automulti(width_to_height_ratio=1.0,hgap=0.05,vgap=0.15,
                hoffset=(0.1,0.05),voffset=(0.05,0.1))
    grace.scale_suffix(0.3,"major_size")
    grace.scale_suffix(0.3,"minor_size")
    grace.scale_suffix(0.3,"char_size")
    grace.write_file('%03d.ps' % panel)
    
n_plots_this_panel = 0
n_panels = 0
grace = MultiPanelGrace()

##################################
# Loop over all applicable users #
##################################

for count_query in count_query_list:
    n_plots_this_panel += 1
    ck_id = count_query['ck_id']
    short_id = ck_id[:10]
    
#    # Skip bad users:               --> skipping this for now
#    if (baduserslist.is_bad_user(short_id)):
#        print "Skipping %s: %s" % (short_id,baduserslist.why_bad_user(short_id))
#        continue
    
コード例 #6
0
ファイル: journals.py プロジェクト: bjmorgan/pygrace
 def __init__(self,*args,**kwargs):
     MultiPanelGrace.__init__(self,*args,**kwargs)
     
     # configure text
     self.set_label_scheme("LATIN")