Ejemplo n.º 1
0
    def addSettings(klass, s):
        """Construct list of settings."""
        widget.Widget.addSettings(s)

        s.add(
            setting.DatasetOrFloatList('xPos', [0.5],
                                       descr=_('List of fractional X '
                                               'coordinates or dataset'),
                                       usertext=_('X positions'),
                                       formatting=False))
        s.add(
            setting.DatasetOrFloatList('yPos', [0.5],
                                       descr=_('List of fractional Y '
                                               'coordinates or dataset'),
                                       usertext=_('Y positions'),
                                       formatting=False))
        s.add(
            setting.Choice('positioning', ['axes', 'relative'],
                           'relative',
                           descr=_('Use axes or fractional '
                                   'position to place label'),
                           usertext=_('Position mode'),
                           formatting=False))
        s.add(
            setting.Axis('xAxis',
                         'x',
                         'horizontal',
                         descr=_('Name of X-axis to use'),
                         usertext=_('X axis')))
        s.add(
            setting.Axis('yAxis',
                         'y',
                         'vertical',
                         descr=_('Name of Y-axis to use'),
                         usertext=_('Y axis')))
Ejemplo n.º 2
0
    def addSettings(klass, s):
        """Construct list of settings."""
        Shape.addSettings(s)

        s.add(
            setting.DatasetOrFloatList('width', [0.1],
                                       descr=_('List of fractional '
                                               'widths or dataset'),
                                       usertext=_('Widths'),
                                       formatting=False), 3)
        s.add(
            setting.DatasetOrFloatList('height', [0.1],
                                       descr=_('List of fractional '
                                               'heights or dataset'),
                                       usertext=_('Heights'),
                                       formatting=False), 4)
        s.add(
            setting.DatasetOrFloatList('rotate', [0.],
                                       descr=_('Rotation angles of '
                                               'shape or dataset'),
                                       usertext=_('Rotate'),
                                       formatting=False), 5)
Ejemplo n.º 3
0
 def __init__(self, name):
     setting.Settings.__init__(self, name, setnsmode='groupedsetting')
     self.add(
         setting.DatasetOrFloatList(
             'points',
             '',
             descr=_('Use color value (0-1) in dataset to paint points'),
             usertext=_('Color markers')), 7)
     self.add(
         setting.Float('min',
                       0.,
                       descr=_('Minimum value of color dataset'),
                       usertext=_('Min val')))
     self.add(
         setting.Float('max',
                       1.,
                       descr=_('Maximum value of color dataset'),
                       usertext=_('Max val')))
     self.add(
         setting.Choice('scaling', ['linear', 'sqrt', 'log', 'squared'],
                        'linear',
                        descr=_('Scaling to transform numbers to color'),
                        usertext=_('Scaling')))
Ejemplo n.º 4
0
    def addSettings(klass, s):
        """Construct list of settings."""
        GenericPlotter.addSettings(s)

        s.add(
            setting.Int('thinfactor',
                        1,
                        minval=1,
                        descr=_('Thin number of markers plotted'
                                ' for each datapoint by this factor'),
                        usertext=_('Thin markers'),
                        formatting=True), 0)
        s.add(
            setting.DistancePt('markerSize',
                               '3pt',
                               descr=_('Size of marker to plot'),
                               usertext=_('Marker size'),
                               formatting=True), 0)
        s.add(
            setting.Marker('marker',
                           'circle',
                           descr=_('Type of marker to plot'),
                           usertext=_('Marker'),
                           formatting=True), 0)
        s.add(
            setting.DatasetOrStr('labels',
                                 '',
                                 descr=_('Dataset or string to label points'),
                                 usertext=_('Labels'),
                                 datatype='text'), 5)
        s.add(
            setting.DatasetOrFloatList(
                'scalePoints',
                '',
                descr=_('Scale size of plotted markers by this dataset or'
                        ' list of values'),
                usertext=_('Scale markers')), 6)

        s.add(ColorSettings('Color'))

        s.add(
            setting.DatasetOrFloatList(
                'yData',
                'y',
                descr=_('Dataset containing y data or list of values'),
                usertext=_('Y data')), 0)
        s.add(
            setting.DatasetOrFloatList(
                'xData',
                'x',
                descr=_('Dataset containing x data or list of values'),
                usertext=_('X data')), 0)
        s.add(
            setting.ErrorStyle('errorStyle',
                               'bar',
                               descr=_('Style of error bars to plot'),
                               usertext=_('Error style'),
                               formatting=True))

        s.add(setting.XYPlotLine('PlotLine',
                                 descr=_('Plot line settings'),
                                 usertext=_('Plot line')),
              pixmap='settings_plotline')
        s.add(setting.Line('MarkerLine',
                           descr=_('Line around the marker settings'),
                           usertext=_('Marker border')),
              pixmap='settings_plotmarkerline')
        s.add(MarkerFillBrush('MarkerFill',
                              descr=_('Marker fill settings'),
                              usertext=_('Marker fill')),
              pixmap='settings_plotmarkerfill')
        s.add(setting.ErrorBarLine('ErrorBarLine',
                                   descr=_('Error bar line settings'),
                                   usertext=_('Error bar line')),
              pixmap='settings_ploterrorline')
        s.add(setting.PointFill('FillBelow',
                                descr=_('Fill below plot line'),
                                usertext=_('Fill below')),
              pixmap='settings_plotfillbelow')
        s.add(setting.PointFill('FillAbove',
                                descr=_('Fill above plot line'),
                                usertext=_('Fill above')),
              pixmap='settings_plotfillabove')
        s.add(setting.PointLabel('Label',
                                 descr=_('Label settings'),
                                 usertext=_('Label')),
              pixmap='settings_axislabel')
Ejemplo n.º 5
0
    def addSettings(klass, s):
        """Construct list of settings."""
        plotters.FreePlotter.addSettings(s)

        s.add( setting.ChoiceSwitch(
                'mode',
                ('length-angle', 'point-to-point'),
                'length-angle',
                descr=_('Provide line position and length,angle or '
                        'first and second points'),
                usertext=_('Mode'),
                formatting=False,
                showfn = lambda val: val == 'length-angle',
                settingstrue = ('length', 'angle'),
                settingsfalse = ('xPos2', 'yPos2'),
                ), 0)

        s.add( setting.DatasetOrFloatList('length', [0.2],
                                          descr=_('List of fractional '
                                                  'lengths or dataset'),
                                          usertext=_('Lengths'),
                                          formatting=False), 4 )
        s.add( setting.DatasetOrFloatList('angle', [0.],
                                          descr=_('Angle of lines or '
                                                  'dataset (degrees)'),
                                          usertext=_('Angles'),
                                          formatting=False), 5 )
        s.add( setting.DatasetOrFloatList('xPos2', [1.],
                                          descr=_('List of fractional X '
                                                  'coordinates or dataset for point 2'),
                                          usertext=_('X positions 2'),
                                          formatting=False), 6 )
        s.add( setting.DatasetOrFloatList('yPos2', [1.],
                                          descr=_('List of fractional Y '
                                                  'coordinates or dataset for point 2'),
                                          usertext=_('Y positions 2'),
                                          formatting=False), 7 )

        s.add( setting.Bool('clip', False,
                            descr=_('Clip line to its container'),
                            usertext=_('Clip'),
                            formatting=True), 0 )

        s.add( setting.Line('Line',
                            descr = _('Line style'),
                            usertext = _('Line')),
               pixmap = 'settings_plotline' )
        s.add( setting.ArrowFill('Fill',
                                 descr = _('Arrow fill settings'),
                                 usertext = _('Arrow fill')),
               pixmap = 'settings_plotmarkerfill' )

        s.add( setting.DistancePt('arrowSize', '5pt',
                                  descr = _('Size of arrow to plot'),
                                  usertext=_('Arrow size'), formatting=True), 0)
        s.add( setting.Arrow('arrowright', 'none',
                             descr = _('Arrow to plot on right side'),
                             usertext=_('Arrow right'), formatting=True), 0)
        s.add( setting.Arrow('arrowleft', 'none',
                             descr = _('Arrow to plot on left side'),
                             usertext=_('Arrow left'), formatting=True), 0)
Ejemplo n.º 6
0
    def addSettings(klass, s):
        """Construct list of settings."""
        GenericPlotter.addSettings(s)

        s.remove('key')
        s.add(
            setting.Choice('whiskermode',
                           ('min/max', '1.5IQR', '1 stddev', '9/91 percentile',
                            '2/98 percentile'),
                           '1.5IQR',
                           descr=_('Whisker mode'),
                           usertext=_('Whisker mode')), 0)

        s.add(
            setting.Choice('direction', ('horizontal', 'vertical'),
                           'vertical',
                           descr=_('Horizontal or vertical boxes'),
                           usertext=_('Direction')), 0)
        s.add(
            setting.DatasetOrStr('labels',
                                 '',
                                 descr=_('Dataset or string to label bars'),
                                 usertext=_('Labels'),
                                 datatype='text'), 0)
        s.add(
            setting.DatasetOrFloatList('posn',
                                       '',
                                       descr=_(
                                           'Dataset or list of values giving '
                                           'positions of boxes (optional)'),
                                       usertext=_('Positions')), 0)

        # calculate statistics from these datasets
        s.add(
            setting.Datasets('values', ('data', ),
                             descr=_('Datasets containing values to '
                                     'calculate statistics for'),
                             usertext=_('Datasets')), 0)

        # alternate mode where data are provided for boxes
        s.add(
            setting.DatasetOrFloatList(
                'whiskermax',
                '',
                descr=_('Dataset with whisker maxima or list of values'),
                usertext=_('Whisker max')), 0)
        s.add(
            setting.DatasetOrFloatList(
                'whiskermin',
                '',
                descr=_('Dataset with whisker minima or list of values'),
                usertext=_('Whisker min')), 0)
        s.add(
            setting.DatasetOrFloatList(
                'boxmax',
                '',
                descr=_('Dataset with box maxima or list of values'),
                usertext=_('Box max')), 0)
        s.add(
            setting.DatasetOrFloatList(
                'boxmin',
                '',
                descr=_('Dataset with box minima or list of values'),
                usertext=_('Box min')), 0)
        s.add(
            setting.DatasetOrFloatList(
                'median',
                '',
                descr=_('Dataset with medians or list of values'),
                usertext=_('Median')), 0)
        s.add(
            setting.DatasetOrFloatList(
                'mean',
                '',
                descr=_('Dataset with means or list of values'),
                usertext=_('Mean')), 0)

        # switch between different modes
        s.add(
            setting.BoolSwitch('calculate',
                               True,
                               descr=_('Calculate statistics from datasets'
                                       ' rather than given manually'),
                               usertext=_('Calculate'),
                               settingstrue=('whiskermode', 'values'),
                               settingsfalse=('boxmin', 'whiskermin', 'boxmax',
                                              'whiskermax', 'mean', 'median')),
            0)

        # formatting options
        s.add(
            setting.Float('fillfraction',
                          0.75,
                          descr=_('Fill fraction of boxes'),
                          usertext=_('Fill fraction'),
                          formatting=True))
        s.add(
            setting.Marker('outliersmarker',
                           'circle',
                           descr=_('Marker for outliers'),
                           usertext=_('Outliers'),
                           formatting=True))
        s.add(
            setting.Marker('meanmarker',
                           'linecross',
                           descr=_('Marker for mean'),
                           usertext=_('Mean'),
                           formatting=True))
        s.add(
            setting.DistancePt('markerSize',
                               '3pt',
                               descr=_('Size of markers to plot'),
                               usertext=_('Markers size'),
                               formatting=True))

        s.add(setting.GraphBrush('Fill',
                                 descr=_('Box fill'),
                                 usertext=_('Box fill')),
              pixmap='settings_bgfill')
        s.add(setting.Line('Border',
                           descr=_('Box border line'),
                           usertext=_('Box border')),
              pixmap='settings_border')
        s.add(setting.Line('Whisker',
                           descr=_('Whisker line'),
                           usertext=_('Whisker line')),
              pixmap='settings_whisker')
        s.add(setting.Line('MarkersLine',
                           descr=_('Line around markers'),
                           usertext=_('Markers border')),
              pixmap='settings_plotmarkerline')
        s.add(setting.BoxPlotMarkerFillBrush('MarkersFill',
                                             descr=_('Markers fill'),
                                             usertext=_('Markers fill')),
              pixmap='settings_plotmarkerfill')