Skip to content

Commit

Permalink
add pyana/examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Jan 9, 2014
1 parent 7e38064 commit 2a0f9d6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Empty file added pyana/examples/__init__.py
Empty file.
33 changes: 33 additions & 0 deletions pyana/examples/gp_datdir.py
@@ -0,0 +1,33 @@
import logging, os
import numpy as np
from collections import OrderedDict
from ..ccsgp.ccsgp import make_plot
from ..aux.utils import getWorkDir, zip_flat, getOpts
from ..aux.config import defaultkey

def gp_datdir(subname):
inDir = os.path.join(getWorkDir(__name__, True), subname)
return 'inDir'
# TODO: prepare data = OrderedDict
outDir = getWorkDir(__name__)
logging.debug(data)
nSets = len(data)
make_plot(
name = os.path.join(outDir, 'gp_from_txt'), # basename of output file
log = [False, True], # logarithmic axes? [x, y]
xr = [xMin, xMax], yr = [yMin, yMax],
data = data,
using = ['1:2:3'] * nSets,
main_opts = ['points'] * nSets, # yerrorbars, boxerrorbars
extra_opts = zip_flat(
[ 'lt 1 lw 4 ps 2 lc %d pt %d' % (i/2, 18+i%2) for i in xrange(nSets) ],
[ "lt 1 lw 4 lc rgb 'grey'" ] * nSets
),
xlabel = 'xlabel', ylabel = 'ylabel',
titles = data.keys(),
key = defaultkey + [
'maxrows 3', 'top', 'outside', 'opaque', 'samplen 0.8',
'font ",22"', 'width -2', 'height 0.2'
]
)
return 'done'

0 comments on commit 2a0f9d6

Please sign in to comment.