Changeset 2699 for trunk


Ignore:
Timestamp:
12/17/12 16:28:37 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No (bug fixes)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: unit tests of sdplot

Put in Release Notes: No

Module(s): asapplotter and sdplot

Description:

Fixed a bug which caused failure of plots by user defined linestyles.
Made sure data is plotted on mpl plotter (not on ASAP plotter) by
plotpointing and plotazel.


Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotbase.py

    r2697 r2699  
    5656        if isinstance(c,str) and len(c) > 0:
    5757            self.colormap = c.split()
    58 
    59         self.lsalias = {"line":  '-', #[1,0],
    60                         "dashdot": '-.',  #[4,2,1,2],
    61                         "dashed" : '--',  #[4,2,4,2],
    62                         "dotted" : ':',  #[1,2],
     58        # line styles need to be set as a list of numbers to use set_dashes
     59        self.lsalias = {"line":  [1,0],
     60                        "dashdot": [4,2,1,2],
     61                        "dashed" : [4,2,4,2],
     62                        "dotted" : [1,2],
    6363                        "dashdotdot": [4,2,1,2,1,2],
    6464                        "dashdashdot": [4,2,4,2,1,2]
     
    9898        self.axes.clear()
    9999        self.color = 0
     100        self.linestyle = 0
    100101        self.lines = []
    101102        self.subplots[self.i]['lines'] = self.lines
  • trunk/python/asapplotter.py

    r2698 r2699  
    4949        self._inikwg = kwargs
    5050
    51         # plot settings
     51        ### plot settings
    5252        self._colormap = None
    5353        self._linestyles = None
     
    5959        self._margins = self.set_margin(refresh=False)
    6060        self._legendloc = None
    61         # scantable plot settings
     61        ### scantable plot settings
    6262        self._panelling = None
    6363        self._stacking = None
     
    6565        self.set_stacking()
    6666        self._hist = rcParams['plotter.histogram']
    67         # scantable dependent settings
     67        ### scantable dependent settings
    6868        self._data = None
    6969        self._abcunit = None
     
    7777        self._ordinate = None
    7878        self._abcissa = None
    79         # cursors for page iteration
     79        ### cursors for page iteration
    8080        self._startrow = 0
    8181        self._ipanel = -1
     
    274274        return []
    275275
    276     # forwards to matplotlib axes
     276
     277    ### Forwards to matplotlib axes ###
    277278    def text(self, *args, **kwargs):
    278279        self._assert_plotter(action="reload")
     
    379380    # end matplotlib.axes fowarding functions
    380381
    381     # forwards to matplotlib.Figure.text
     382
     383    ### Forwards to matplotlib.Figure.text ###
    382384    def figtext(self, *args, **kwargs):
    383385        """
     
    391393    # end matplotlib.Figure.text forwarding function
    392394
    393     # plot setttings
     395
     396    ### Set Plot parameters ###
    394397    @asaplog_post_dec
    395398    def set_data(self, scan, refresh=True):
     
    954957            return start,end
    955958
    956     # reset methods
     959
     960    ### Reset methods ###
    957961    def _reset(self):
    958962        self._usermask = []
     
    978982        self._panelrows = []
    979983
    980     # scantable plot methods
     984
     985    ### Actual scantable plot methods ###
    981986    @asaplog_post_dec
    982987    def plot(self, scan=None):
     
    13061311        from matplotlib.ticker import MultipleLocator
    13071312        from numpy import array, pi
     1313        if PL.gcf() == self._plotter.figure:
     1314            # the current figure is ASAP plotter. Use mpl plotter
     1315            figids = PL.get_fignums()
     1316            if figids[-1] > 0:
     1317                PL.figure(figids[-1])
     1318            else:
     1319                PL.figure(1)
    13081320        if not visible or not self._visible:
    13091321            PL.ioff()
     
    15321544        from matplotlib import pylab as PL
    15331545        from numpy import array, pi
     1546        if PL.gcf() == self._plotter.figure:
     1547            # the current figure is ASAP plotter. Use mpl plotter
     1548            figids = PL.get_fignums()
     1549            if figids[-1] > 0:
     1550                PL.figure(figids[-1])
     1551            else:
     1552                PL.figure(1)
    15341553        if not visible or not self._visible:
    15351554            PL.ioff()
Note: See TracChangeset for help on using the changeset viewer.