Esempio n. 1
0
 def __init__(self, name, **args):
     setting.Line.__init__(self, name, **args)
     self.add( setting.DistancePt( 'length',
                                   '3pt',
                                   descr = _('Length of minor ticks'),
                                   usertext= _('Length')) )
     self.add( setting.Int( 'number',
                            20,
                            descr = _('Number of minor ticks to aim for'),
                            usertext= _('Number') ) )
Esempio n. 2
0
 def __init__(self, name, **args):
     setting.Line.__init__(self, name, **args)
     self.add( setting.DistancePt( 'length',
                                   '6pt',
                                   descr = _('Length of major ticks'),
                                   usertext= _('Length') ) )
     self.add( setting.Int( 'number',
                            6,
                            descr = _('Number of major ticks to aim for'),
                            usertext= _('Number') ) )
     self.add( setting.FloatList('manualTicks',
                                 [],
                                 descr = _('List of tick values'
                                           ' overriding defaults'),
                                 usertext= _('Manual ticks') ) )
Esempio n. 3
0
 def __init__(self, name, **args):
     setting.Text.__init__(self, name, **args)
     self.add( setting.Bool( 'atEdge', False,
                             descr = _('Place axis label close to edge'
                                       ' of graph'),
                             usertext= _('At edge') ) )
     self.add( setting.RotateInterval(
             'rotate', '0',
             descr = 'Angle by which to rotate label by',
             usertext='Rotate') )
     self.add( setting.DistancePt( 'offset',
                                   '0pt',
                                   descr = _('Additional offset of axis label'
                                             ' from axis tick labels'),
                                   usertext= _('Label offset') ) )
     self.add( setting.Choice(
             'position',
             ('at-minimum', 'centre', 'at-maximum'),
             'centre',
             descr = _('Position of axis label'),
             usertext = _('Position') ) )
Esempio n. 4
0
    def __init__(self, name, **args):
        setting.Text.__init__(self, name, **args)
        self.add( setting.RotateInterval(
                'rotate', '0',
                descr = _('Angle by which to rotate label by'),
                usertext= _('Rotate') ) )
        self.add( setting.ChoiceOrMore( 'format',
                                        TickLabel.formatchoices,
                                        'Auto',
                                        descr = _('Format of the tick labels'),
                                        descriptions=TickLabel.descriptions,
                                        usertext= _('Format') ) )

        self.add( setting.Float('scale', 1.,
                                descr=_('A scale factor to apply to the values '
                                        'of the tick labels'),
                                usertext=_('Scale') ) )

        self.add( setting.DistancePt( 'offset',
                                      '0pt',
                                      descr = _('Additional offset of axis tick '
                                                'labels from axis'),
                                      usertext= _('Tick offset') ) )
Esempio n. 5
0
 def __init__(self, name, **args):
     setting.Line.__init__(self, name, **args)
     self.add(
         setting.DistancePt('length',
                            '6pt',
                            descr=_('Length of major ticks'),
                            usertext=_('Length')))
     self.add(
         setting.Int('number',
                     6,
                     descr=_('Number of major ticks to aim for'),
                     usertext=_('Number')))
     self.add(
         setting.Bool('hidespokes',
                      False,
                      descr=_('Hide radial spokes'),
                      usertext=_('Hide spokes')))
     self.add(
         setting.Bool('hideannuli',
                      False,
                      descr=_('Hide annuli'),
                      usertext=_('Hide annuli')))
     self.get('color').newDefault('grey')
Esempio n. 6
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')
Esempio n. 7
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)
Esempio n. 8
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')
Esempio n. 9
0
    def addSettings(klass, s):
        '''Construct list of settings.'''
        plotters.GenericPlotter.addSettings(s)

        # datasets
        s.add(
            setting.Dataset('data1',
                            '',
                            dimensions=2,
                            descr=_('X coordinate length or vector magnitude'),
                            usertext=_('dx or r')), 0)
        s.add(
            setting.Dataset('data2',
                            '',
                            dimensions=2,
                            descr=_('Y coordinate length or vector angle'),
                            usertext=_('dy or theta')), 1)
        s.add(
            setting.Choice('mode', ['cartesian', 'polar'],
                           'cartesian',
                           descr=_('Cartesian (dx,dy) or polar (r,theta)'),
                           usertext=_('Mode')), 2)

        # formatting
        s.add(
            setting.DistancePt('baselength',
                               '10pt',
                               descr=_('Base length of unit vector'),
                               usertext=_('Base length'),
                               formatting=True), 0)
        s.add(
            setting.DistancePt('arrowsize',
                               '2pt',
                               descr=_('Size of any arrows'),
                               usertext=_('Arrow size'),
                               formatting=True), 1)
        s.add(
            setting.Bool('scalearrow',
                         True,
                         descr=_('Scale arrow head by length'),
                         usertext=_('Scale arrow'),
                         formatting=True), 2)
        s.add(
            setting.Arrow('arrowfront',
                          'none',
                          descr=_('Arrow in front direction'),
                          usertext=_('Arrow front'),
                          formatting=True), 3)
        s.add(
            setting.Arrow('arrowback',
                          'none',
                          descr=_('Arrow in back direction'),
                          usertext=_('Arrow back'),
                          formatting=True), 4)

        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')