Changeset b4b8589 in sasview for src/sas/qtgui/Plotter.py


Ignore:
Timestamp:
Dec 8, 2016 5:53:56 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
fecfe28
Parents:
cad617b
Message:

Code review from WP. Also, added 1D plots with error bars as default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotter.py

    r416fa8f rb4b8589  
    2323        self.title(title=value.title) 
    2424 
    25     def plot(self, marker=None, linestyle=None): 
     25    def plot(self, marker=None, linestyle=None, hide_error=False): 
    2626        """ 
    2727        Plot self._data 
     
    3434 
    3535        if linestyle == None: 
    36             linestyle = '-' 
    37  
    38         # plot data with title 
    39         ax.plot(self._data.view.x, 
    40                 self._data.view.y, 
    41                 marker=marker, 
    42                 linestyle=linestyle, 
    43                 label=self._title) 
     36            linestyle = '' 
     37 
     38        # plot data with/without errorbars 
     39        if hide_error: 
     40            ax.plot(self._data.view.x, self._data.view.y, 
     41                    marker=marker, 
     42                    linestyle=linestyle, 
     43                    label=self._title) 
     44        else: 
     45            ax.errorbar(self._data.view.x, self._data.view.y, 
     46                        yerr=self._data.view.dx, xerr=None, 
     47                        capsize=2, linestyle='', 
     48                        barsabove=False, 
     49                        marker=marker, 
     50                        lolims=False, uplims=False, 
     51                        xlolims=False, xuplims=False, 
     52                        label=self._title) 
    4453 
    4554        # Now add the legend with some customizations. 
     
    206215        QtGui.QDialog.__init__(self) 
    207216        PlotterWidget.__init__(self, manager=parent, quickplot=quickplot) 
    208  
     217        icon = QtGui.QIcon() 
     218        icon.addPixmap(QtGui.QPixmap(":/res/ball.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 
     219        self.setWindowIcon(icon) 
     220 
     221 
Note: See TracChangeset for help on using the changeset viewer.