#!/usr/bin/env python
################################################################################
# NAME     : plotter
# PURPOSE  : plot cartesian, polar, parametric equation sets
# AUTHOR   : Richard Booth
# DATE     : Sat Nov  9 11:07:29 2013
# -----------------------------------------------------------------------------
# NOTES    : 
#   * CREATED BY : Plotter
################################################################################
from __future__ import print_function
import sys
from decida.Plotterm import Plotterm
#-----------------------------------------------------------------------------
# usage
#-----------------------------------------------------------------------------
def usage() :
    print("""\
  usage :
      plotter ?options?
  options :
      -h       print help information
      -xmat    don't use matplotlib
    """)
    exit()
#-----------------------------------------------------------------------------
# command-line arguments
#-----------------------------------------------------------------------------
use_matplotlib = True
args = sys.argv[1:]
while len(args) > 0 :
    arg = args.pop(0)
    if   arg == "-h" or arg == "-help" :
        usage()
    elif arg == "-xmat" :
        use_matplotlib = False
    else :
        print("un-supported option: \"%s\"" % (arg))
        usage()
#-----------------------------------------------------------------------------
# invoke plotter
#-----------------------------------------------------------------------------
Plotterm(
    use_matplotlib=use_matplotlib,
    plot_type="cartesian",
    sample_type="linear",
    npts=1000,
    min=0.0,
    max=5.0,
    xcol="time",
    ycol="v",
    acol="theta",
    rcol="r",
    tcol="t",
    equations="""v=sin(time*3)"""
)
