Ignore:
Timestamp:
04/28/14 12:31:00 (11 years ago)
Author:
cborstad
Message:

enabled text option for python plots

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/applyoptions.py

    r17838 r17856  
    227227                        cb.add_lines(locs,['k' for i in range(len(locs))],npy.ones_like(locs))
    228228                if options.exist('colorbartitle'):
    229                         cb.set_label(options.getfieldvalue('colorbartitle'),fontsize=fontsize)
     229                        if options.exist('colorbartitlepad'):
     230                                cb.set_label(options.getfieldvalue('colorbartitle'),\
     231                                                labelpad=options.getfieldvalue('colorbartitlepad'),fontsize=fontsize)
     232                        else:
     233                                cb.set_label(options.getfieldvalue('colorbartitle'),fontsize=fontsize)
    230234                cb.ax.tick_params(labelsize=fontsize)
    231235        #}}}
     
    235239        #expdisp
    236240
    237         #text
     241        #text {{{
     242        if options.exist('text'):
     243                text=options.getfieldvalue('text')
     244                textx=options.getfieldvalue('textx')
     245                texty=options.getfieldvalue('texty')
     246                textsize=options.getfieldvalue('textsize')
     247                textcolor=options.getfieldvalue('textcolor')
     248                textweight=options.getfieldvalue('textweight')
     249                textrotation=options.getfieldvalue('textrotation')
     250                for label,x,y,size,color,weight,rotation in zip(text,textx,texty,textsize,textcolor,textweight,textrotation):
     251                        ax.text(x,y,label,transform=ax.transAxes,fontsize=size,color=color,weight=weight,rotation=rotation)
     252        #}}}
    238253
    239254        #north arrow
Note: See TracChangeset for help on using the changeset viewer.