GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — bashplotlib/bashplotlib/cli/scatter.py at master · austinogilvie/bashplotlib Expand file tree/ Copy pathscatter.pyMore file actions 53 lines (47 loc) · 2.11 KB / Copy pathscatter.pyFile metadata and controls53 lines (47 loc) · 2.11 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 #!/usr/bin/env python # -*- coding: utf-8 -*- """scatter Usage: scatter ((FILE | -f FILENAME) | (-X XDATA -y YDATA)) [-t TITLE -s SIZE -p MARKERSHAPE -c COLOUR] [-h -H] Arguments: FILE Csv with 2 columns for x and y [default: ] -f --file FILENAME Same as FILE but shorter and less explicit [default: ] -X --xs-file XDATA Text file with 1 column for the X values [default: ] -y --ys-file YDATA Text file with 1 column for the y values [default: ] -t --title TITLE Title for the chart [default: ] -s --size SIZE Height of the histogram in lines [default: 20.0] -p --pch MARKERSHAPE Shape of each bar [default: x] -c --colour COLOUR Colour of the plot (Pink, blue, green, red, white, aqua, grey, yellow) [default: white] -H --skip-header Skip the first row in FILENAME, XDATA, and YDATA [default: False] Options: -h --help Show this screen Examples: $ scatter2 -X data/exp.txt -y data/exp.txt """ from docopt import docopt from bashplotlib.cli.helpers import read_stdin_or_timeout def parse_args(): """takes __doc__ for given cmd. Returns parsed args using docopt. """ args = docopt(__doc__) for k, v in args.iteritems(): if v == 'None': args[k] = None if args['--file'] is None and (args['--xs-file'] is None or args['--ys-file'] is None): print __doc__ sys.exit(1) if args['FILE'] is not None or args['--file'] is not None: if args['FILE'] and args['FILE'] != args['--file']: args['--file'] = args['FILE'] if args['--file'] == 'stdin': args['--file'] = read_stdin_or_timeout() plot_params = { 'filename': args['--file'], 'xs': args['--xs-file'], 'ys': args['--ys-file'], 'size': float(args['--size']), 'pch': args['--pch'], 'colour': args['--colour'], 'title': args['--title'], } return {k: v for k,v in plot_params.items() if v is not None and v != ""} |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |