Ignore:
Timestamp:
Nov 9, 2011, 4:52:59 PM (13 years ago)
Author:
acolaitis
Message:

Added possibility to change plotting window for contour plots, through --xmin, --xmax, --ymin, --ymax. When specifying xmin, there is a priori no need to specify xmax (it will use the max of the x_axis). When specifying values for a y-axis with decreasing-with-height values, both ymin and ymax must be specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/gcm.py

    r363 r369  
    5656    parser.add_option('--Mope',         action='store',dest='vmaxope', type="float",   default=0.,  help='bounding maximum value for inter-file operation')
    5757    parser.add_option('--titleref',     action='store',dest='titref',  type="string",  default="fill",  help='title for the reference file. Default: title of figure (1)')
     58    parser.add_option('--xmax',         action='store',dest='xmax',    type="float",   default=None,    help='Maximum value for the y-axis in contour-plots. Default is max(xaxis).')                                                                                                                                   
     59    parser.add_option('--ymax',         action='store',dest='ymax',    type="float",   default=None,    help='Maximum value for the y-axis in contour-plots Default is max(yaxis)')
     60    parser.add_option('--xmin',         action='store',dest='xmin',    type="float",   default=None,    help='Minimum value for the y-axis in contour-plots. Default is min(xaxis).')
     61    parser.add_option('--ymin',         action='store',dest='ymin',    type="float",   default=None,    help='Minimum value for the y-axis in contour-plots Default is min(yaxis)')
    5862    parser.add_option('--inverty',      action='store_true',dest='inverty',             default=False, help='Force matplotlib.pyplot to revert the y-axis. Can be of use when plotting data along pressure levels. (pyplot naturally tend to plot the z-axis with increasing values)')
    5963   
     
    200204        else:
    201205           reffile=opt.fref
     206# Divers ####################################################
     207   
     208        zexaxis=[opt.xmin,opt.xmax]
     209        zeyaxis=[opt.ymin,opt.ymax]
    202210
    203211        #############
     
    214222                outputname=opt.output,resolution=opt.res,\
    215223                ope=opt.operation,fileref=reffile,minop=opt.vminope,maxop=opt.vmaxope,titleref=opt.titref,\
    216                 invert_y=opt.inverty)
     224                invert_y=opt.inverty,xaxis=zexaxis,yaxis=zeyaxis)
    217225        print 'Done: '+name
    218226        system("rm -f to_be_erased")
Note: See TracChangeset for help on using the changeset viewer.