Ignore:
Timestamp:
04/22/11 18:21:29 (13 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No (a fix)

Ready for Test: Yes

Interface Changes: added a new method new_asaplot() to module asapplotter which returns asaplot instance based on your backend selection.

What Interface Changed:

Test Programs: sdaverage, sdsmooth with verify=True and plotlevel > 0

Put in Release Notes: No

Module(s):

Description: proper handling of plotting in non-TkAgg? backend.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r2147 r2150  
    88
    99import re
     10
     11def new_asaplot(visible=None,**kwargs):
     12    """
     13    Returns a new asaplot instance based on the backend settings.
     14    """
     15    if visible == None:
     16        visible = rcParams['plotter.gui']
     17
     18    backend=matplotlib.get_backend()
     19    if not visible:
     20        from asap.asaplot import asaplot
     21    elif backend == 'TkAgg':
     22        from asap.asaplotgui import asaplotgui as asaplot
     23    elif backend == 'Qt4Agg':
     24        from asap.asaplotgui_qt4 import asaplotgui as asaplot
     25    elif backend == 'GTkAgg':
     26        from asap.asaplotgui_gtk import asaplotgui as asaplot
     27    else:
     28        from asap.asaplot import asaplot
     29    return asaplot(**kwargs)
    1030
    1131class asapplotter:
     
    6686
    6787    def _newplotter(self, **kwargs):
    68         backend=matplotlib.get_backend()
    69         if not self._visible:
    70             from asap.asaplot import asaplot
    71         elif backend == 'TkAgg':
    72             from asap.asaplotgui import asaplotgui as asaplot
    73         elif backend == 'Qt4Agg':
    74             from asap.asaplotgui_qt4 import asaplotgui as asaplot
    75         elif backend == 'GTkAgg':
    76             from asap.asaplotgui_gtk import asaplotgui as asaplot
    77         else:
    78             from asap.asaplot import asaplot
    79         return asaplot(**kwargs)
     88        return new_asaplot(self._visible,**kwargs)
    8089
    8190    def _newcasabar(self):
Note: See TracChangeset for help on using the changeset viewer.