Skip to content

Commit

Permalink
Updating to use Argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosplanchon committed Mar 9, 2016
1 parent a86e088 commit 5b043e8
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions code_to_use/bashplotlib/scatterplot.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#!/usr/bin/env python3

'''
Plotting terminal based scatterplots
'''

import csv
import sys
import optparse
import argparse
from helpers import *
from commandhelp import scatter

Expand Down Expand Up @@ -79,15 +78,15 @@ def plot_scatter(f, xs, ys, size, pch, colour, title):

def main():

parser = optparse.OptionParser(usage=scatter['usage'])
parser = argparse.ArgumentParser(usage=hist['usage'])

parser.add_option('-f', '--file', help='a csv w/ x and y coordinates', default=None, dest='f')
parser.add_option('-t', '--title', help='title for the chart', default='', dest='t')
parser.add_option('-x', help='x coordinates', default=None, dest='x')
parser.add_option('-y', help='y coordinates', default=None, dest='y')
parser.add_option('-s', '--size',help='y coordinates', default=20, dest='size', type='int')
parser.add_option('-p', '--pch',help='shape of point', default='x', dest='pch')
parser.add_option('-c', '--colour', help='colour of the plot (%s)' % colour_help, default='default', dest='colour')
parser.add_argument('-f', '--file', help='a csv w/ x and y coordinates', default=None, dest='f')
parser.add_argument('-t', '--title', help='title for the chart', default='', dest='t')
parser.add_argument('-x', help='x coordinates', default=None, dest='x')
parser.add_argument('-y', help='y coordinates', default=None, dest='y')
parser.add_argument('-s', '--size',help='y coordinates', default=20, dest='size', type='int')
parser.add_argument('-p', '--pch',help='shape of point', default='x', dest='pch')
parser.add_argument('-c', '--colour', help='colour of the plot (%s)' % colour_help, default='default', dest='colour')

opts, args = parser.parse_args()

Expand Down

0 comments on commit 5b043e8

Please sign in to comment.