示例#1
0
    def addSettings(klass, s):
        '''Construct list of settings.'''
        Widget.addSettings(s)

        s.add( setting.Distance( 'leftMargin',
                                 '1.7cm',
                                 descr=_('Distance from left of graph to edge'),
                                 usertext=_('Left margin'),
                                 formatting=True) )
        s.add( setting.Distance( 'rightMargin',
                                 '0.2cm',
                                 descr=_('Distance from right of graph to edge'),
                                 usertext=_('Right margin'),
                                 formatting=True) )
        s.add( setting.Distance( 'topMargin',
                                 '0.2cm',
                                 descr=_('Distance from top of graph to edge'),
                                 usertext=_('Top margin'),
                                 formatting=True) )
        s.add( setting.Distance( 'bottomMargin',
                                 '1.7cm',
                                 descr=_('Distance from bottom of graph to edge'),
                                 usertext=_('Bottom margin'),
                                 formatting=True) )
        s.add( setting.GraphBrush( 'Background',
                                   descr = _('Background plot fill'),
                                   usertext=_('Background')),
               pixmap='settings_bgfill' )
        s.add( setting.Line('Border', descr = _('Graph border line'),
                            usertext=_('Border')),
               pixmap='settings_border')
示例#2
0
    def addSettings(klass, s):
        """Construct list of settings."""
        plotters.FreePlotter.addSettings(s)

        s.add(setting.Line('Line',
                           descr=_('Line around polygon'),
                           usertext=_('Line')),
              pixmap='settings_plotline')
        s.add(setting.BrushExtended('Fill',
                                    descr=_('Fill within polygon'),
                                    usertext=_('Fill')),
              pixmap='settings_plotfillbelow')
示例#3
0
    def addSettings(klass, s):
        """Construct list of settings."""
        GenericPlotter.addSettings(s)

        s.add(
            setting.Int('steps',
                        50,
                        minval=3,
                        descr=_('Number of steps to evaluate the function'
                                ' over'),
                        usertext=_('Steps'),
                        formatting=True), 0)
        s.add(
            setting.Choice('variable', ['x', 'y'],
                           'x',
                           descr=_('Variable the function is a function of'),
                           usertext=_('Variable')), 0)
        s.add(
            setting.Str('function',
                        'x',
                        descr=_('Function expression'),
                        usertext=_('Function')), 0)

        s.add(
            setting.FloatOrAuto(
                'min',
                'Auto',
                descr=_('Minimum value at which to plot function'),
                usertext=_('Min')))

        s.add(
            setting.FloatOrAuto(
                'max',
                'Auto',
                descr=_('Maximum value at which to plot function'),
                usertext=_('Max')))

        s.add(setting.Line('Line',
                           descr=_('Function line settings'),
                           usertext=_('Plot line')),
              pixmap='settings_plotline')

        s.add(setting.PlotterFill('FillBelow',
                                  descr=_('Fill below function'),
                                  usertext=_('Fill below')),
              pixmap='settings_plotfillbelow')

        s.add(setting.PlotterFill('FillAbove',
                                  descr=_('Fill above function'),
                                  usertext=_('Fill above')),
              pixmap='settings_plotfillabove')
示例#4
0
    def addSettings(klass, s):
        """Construct list of settings."""
        axis.Axis.addSettings(s)

        s.add( setting.WidgetChoice('widgetName', '',
                                    descr=_('Corresponding widget'),
                                    widgettypes=('image', 'xy'),
                                    usertext = _('Widget')), 0 )

        s.get('log').readonly = True
        s.get('datascale').readonly = True

        s.add( setting.AlignHorzWManual( 'horzPosn',
                                         'right',
                                         descr = _('Horizontal position'),
                                         usertext=_('Horz posn'),
                                         formatting=True) )
        s.add( setting.AlignVertWManual( 'vertPosn',
                                         'bottom',
                                         descr = _('Vertical position'),
                                         usertext=_('Vert posn'),
                                         formatting=True) )
        s.add( setting.DistanceOrAuto('width', 'Auto',
                                      descr = _('Width of colorbar'),
                                      usertext=_('Width'),
                                      formatting=True) )
        s.add( setting.DistanceOrAuto('height', 'Auto',
                                      descr = _('Height of colorbar'),
                                      usertext=_('Height'),
                                      formatting=True) )
        
        s.add( setting.Float( 'horzManual',
                              0.,
                              descr = _('Manual horizontal fractional position'),
                              usertext=_('Horz manual'),
                              formatting=True) )
        s.add( setting.Float( 'vertManual',
                              0.,
                              descr = _('Manual vertical fractional position'),
                              usertext=_('Vert manual'),
                              formatting=True) )

        s.add( setting.Line('Border', descr = _('Colorbar border line'),
                            usertext=_('Border')),
               pixmap='settings_border')

        s.add( setting.SettingBackwardCompat('image', 'widgetName', None) )
示例#5
0
    def addSettings(klass, s):
        """Construct list of settings."""
        plotters.FreePlotter.addSettings(s)

        s.add(setting.ShapeFill('Fill',
                                descr=_('Shape fill'),
                                usertext=_('Fill')),
              pixmap='settings_bgfill')
        s.add(setting.Line('Border',
                           descr=_('Shape border'),
                           usertext=_('Border')),
              pixmap='settings_border')
        s.add(
            setting.Bool('clip',
                         False,
                         descr=_('Clip shape to its container'),
                         usertext=_('Clip'),
                         formatting=True))
示例#6
0
    def addSettings(klass, s):
        '''Settings for widget.'''
        Widget.addSettings(s)

        s.add( setting.Str('function', 'a',
                           descr=_('Function expression'),
                           usertext=_('Function')) )
        s.add( setting.Choice('variable', ['a', 'b'], 'a',
                              descr=_('Variable the function is a function of'),
                              usertext=_('Variable')) )
        s.add(setting.FloatOrAuto('min', 'Auto',
                                  descr=_('Minimum value at which to plot function'),
                                  usertext=_('Min')))
        
        s.add(setting.FloatOrAuto('max', 'Auto',
                                  descr=_('Maximum value at which to plot function'),
                                  usertext=_('Max')))


        s.add( setting.Line('PlotLine',
                            descr = _('Plot line settings'),
                            usertext = _('Plot line')),
               pixmap = 'settings_plotline' )
        s.add( FillBrush('Fill1',
                         descr = _('Fill settings (1)'),
                         usertext = _('Area fill 1')),
               pixmap = 'settings_plotfillbelow' )
        s.add( FillBrush('Fill2',
                         descr = _('Fill settings (2)'),
                         usertext = _('Area fill 2')),
               pixmap = 'settings_plotfillbelow' )

        s.add( setting.Int('steps', 50,
                           descr = _('Number of steps to evaluate the function'
                                     ' over'),
                           usertext=_('Steps'), formatting=True), 0 )
示例#7
0
    def addSettings(klass, s):
        """Construct list of settings."""
        widget.Widget.addSettings(s)

        s.add( setting.Text('Text',
                            descr = _('Text settings'),
                            usertext=_('Text')),
               pixmap = 'settings_axislabel' )
        s.add( setting.KeyBrush('Background',
                                descr = _('Key background fill'),
                                usertext=_('Background')),
               pixmap = 'settings_bgfill' )
        s.add( setting.Line('Border',
                            descr = _('Key border line'),
                            usertext=_('Border')),
               pixmap = 'settings_border' )

        s.add( setting.Str('title', '',
                           descr=_('Key title text'),
                           usertext=_('Title')) )

        s.add( setting.AlignHorzWManual( 'horzPosn',
                                         'right',
                                         descr = _('Horizontal key position'),
                                         usertext=_('Horz posn'),
                                         formatting=True) )
        s.add( setting.AlignVertWManual( 'vertPosn',
                                         'bottom',
                                         descr = _('Vertical key position'),
                                         usertext=_('Vert posn'),
                                         formatting=True) )
                               
        s.add( setting.Distance('keyLength',
                                '1cm',
                                descr = _('Length of line to show in sample'),
                                usertext=_('Key length'),
                                formatting=True) )
        
        s.add( setting.AlignVert( 'keyAlign',
                                  'top',
                                  descr = _('Alignment of key symbols relative to text'),
                                  usertext = _('Key alignment'),
                                  formatting = True) )

        s.add( setting.Float( 'horzManual',
                              0.,
                              descr = _('Manual horizontal fractional position'),
                              usertext=_('Horz manual'),
                              formatting=True) )
        s.add( setting.Float( 'vertManual',
                              0.,
                              descr = _('Manual vertical fractional position'),
                              usertext=_('Vert manual'),
                              formatting=True) )

        s.add( setting.Float( 'marginSize',
                              1.,
                              minval = 0.,
                              descr = _('Width of margin in characters'),
                              usertext=_('Margin size'),
                              formatting=True) )

        s.add( setting.Int( 'columns',
                            1,
                            descr = _('Number of columns in key'),
                            usertext = _('Columns'),
                            minval = 1,
                            maxval = 100,
                            formatting = True) )
示例#8
0
    def addSettings(klass, s):
        """Construct list of settings."""
        widget.Widget.addSettings(s)
        s.add( setting.Str('label', '',
                           descr=_('Axis label text'),
                           usertext=_('Label')) )
        s.add( setting.AxisBound('min', 'Auto',
                                 descr=_('Minimum value of axis'),
                                 usertext=_('Min')) )
        s.add( setting.AxisBound('max', 'Auto',
                                 descr=_('Maximum value of axis'),
                                 usertext=_('Max')) )
        s.add( setting.Bool('log', False,
                            descr = _('Whether axis is logarithmic'),
                            usertext=_('Log')) )
        s.add( setting.Choice(
                'autoRange',
                ('exact', 'next-tick', '+2%', '+5%', '+10%', '+15%'),
                'next-tick',
                descr = _('If axis range not specified, use range of '
                          'data and this setting'),
                descriptions = (_('Use exact data range'),
                                _('Use data range, rounding up to tick marks'),
                                _('Use data range, adding 2% of range'),
                                _('Use data range, adding 5% of range'),
                                _('Use data range, adding 10% of range'),
                                _('Use data range, adding 15% of range'),
                                ),
                formatting = True,
                usertext = _('Auto range') ) )
        s.add( setting.Choice('mode',
                              ('numeric', 'datetime', 'labels'), 
                              'numeric', 
                              descr = _('Type of ticks to show on on axis'), 
                              usertext=_('Mode')) )

        s.add( setting.SettingBackwardCompat(
                'autoExtend', 'autoRange', True,
                translatefn = lambda x: ('exact', 'next-tick')[x],
                formatting=True ) )

        # this setting no longer used
        s.add( setting.Bool('autoExtendZero', True,
                            descr = _('Extend axis to zero if close (UNUSED)'),
                            usertext=_('Zero extend'),
                            hidden=True,
                            formatting=True) )

        s.add( setting.Bool('autoMirror', True,
                            descr = _('Place axis on opposite side of graph '
                                      'if none'),
                            usertext=_('Auto mirror'),
                            formatting=True) )
        s.add( setting.Bool('reflect', False,
                            descr = _('Place axis text and ticks on other side'
                                      ' of axis'),
                            usertext=_('Reflect'),
                            formatting=True) )
        s.add( setting.Bool('outerticks', False,
                            descr = _('Place ticks on outside of graph'),
                            usertext=_('Outer ticks'),
                            formatting=True) )

        s.add( setting.Float('datascale', 1.,
                             descr=_('Scale data plotted by this factor'),
                             usertext=_('Scale')) )

        s.add( setting.Choice('direction',
                              ['horizontal', 'vertical'],
                              'horizontal',
                              descr = _('Direction of axis'),
                              usertext=_('Direction')) )
        s.add( setting.Float('lowerPosition', 0.,
                             descr=_('Fractional position of lower end of '
                                     'axis on graph'),
                             usertext=_('Min position')) )
        s.add( setting.Float('upperPosition', 1.,
                             descr=_('Fractional position of upper end of '
                                     'axis on graph'),
                             usertext=_('Max position')) )
        s.add( setting.Float('otherPosition', 0.,
                             descr=_('Fractional position of axis '
                                     'in its perpendicular direction'),
                             usertext=_('Axis position')) )

        s.add( setting.WidgetPath('match', '',
                                  descr =
                                  _('Match the scale of this axis to the '
                                    'axis specified'),
                                  usertext=_('Match'),
                                  allowedwidgets = [Axis] ))

        s.add( setting.Line('Line',
                            descr = _('Axis line settings'),
                            usertext = _('Axis line')),
               pixmap='settings_axisline' )
        s.add( AxisLabel('Label',
                         descr = _('Axis label settings'),
                         usertext = _('Axis label')),
               pixmap='settings_axislabel' )
        s.add( TickLabel('TickLabels',
                         descr = _('Tick label settings'),
                         usertext = _('Tick labels')),
               pixmap='settings_axisticklabels' )
        s.add( MajorTick('MajorTicks',
                         descr = _('Major tick line settings'),
                         usertext = _('Major ticks')),
               pixmap='settings_axismajorticks' )
        s.add( MinorTick('MinorTicks',
                         descr = _('Minor tick line settings'),
                         usertext = _('Minor ticks')),
               pixmap='settings_axisminorticks' )
        s.add( GridLine('GridLines',
                        descr = _('Grid line settings'),
                        usertext = _('Grid lines')),
               pixmap='settings_axisgridlines' )
        s.add( MinorGridLine('MinorGridLines',
                             descr = _('Minor grid line settings'),
                             usertext = _('Grid lines for minor ticks')),
               pixmap='settings_axisminorgridlines' )
示例#9
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')
示例#10
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)
示例#11
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')
示例#12
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')