Changeset 19426


Ignore:
Timestamp:
07/03/15 07:24:45 (10 years ago)
Author:
cborstad
Message:

BUG: textposition can be passed as a list or a nested list; fix to handle this

File:
1 edited

Legend:

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

    r18647 r19426  
    6161                if not isinstance(textpos,list):
    6262                        raise Exception('textposition should be passed as a list')
    63                 textx=[item[0] for item in textpos]
    64                 texty=[item[1] for item in textpos]
     63                if any(isinstance(i,list) for i in textpos):
     64                    textx=[item[0] for item in textpos]
     65                    texty=[item[1] for item in textpos]
     66                else:
     67                    textx=[textpos[0]]
     68                    texty=[textpos[1]]
    6569                if len(textx)!=numtext or len(texty)!=numtext:
    6670                        raise Exception('textposition should contain one list of x,y vertices for every text instance')
Note: See TracChangeset for help on using the changeset viewer.