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

        s.add(
            setting.Int('rows',
                        2,
                        descr='Number of rows in grid',
                        usertext='Number of rows'))
        s.add(
            setting.Int('columns',
                        2,
                        descr='Number of columns in grid',
                        usertext='Number of columns'))

        s.add(
            setting.FloatList('scaleRows', [],
                              descr='Row scaling factors. A sequence'
                              ' of values\nby which to scale rows '
                              'relative to each other.',
                              usertext='Row scalings'))
        s.add(
            setting.FloatList('scaleCols', [],
                              descr='Column scaling factors. A sequence'
                              ' of values\nby which to scale columns'
                              ' relative to each other.',
                              usertext='Column scalings'))

        s.add(
            setting.Distance('leftMargin',
                             '1.7cm',
                             descr='Distance from left of grid to '
                             'edge of page',
                             usertext='Left margin',
                             formatting=True))
        s.add(
            setting.Distance('rightMargin',
                             '0.2cm',
                             descr='Distance from right of grid to '
                             'edge of page',
                             usertext='Right margin',
                             formatting=True))
        s.add(
            setting.Distance('topMargin',
                             '0.2cm',
                             descr='Distance from top of grid to '
                             'edge of page',
                             usertext='Top margin',
                             formatting=True))
        s.add(
            setting.Distance('bottomMargin',
                             '1.7cm',
                             descr='Distance from bottom of grid'
                             'to edge of page',
                             usertext='Bottom margin',
                             formatting=True))
Ejemplo n.º 2
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') ) )
Ejemplo n.º 3
0
    def addSettings(klass, s):
        """Construct list of settings."""
        BoxShape.addSettings(s)

        s.add(
            setting.Int('rounding',
                        0,
                        minval=0,
                        maxval=100,
                        descr=_('Round corners with this percentage'),
                        usertext=_('Rounding corners'),
                        formatting=True))
Ejemplo n.º 4
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')
Ejemplo n.º 5
0
    def addSettings(klass, s):
        """Construct list of settings."""
        FunctionPlotter.addSettings(s)

        s.add( setting.FloatDict('values',
                                 {'a': 0.0, 'b': 1.0},
                                 descr = _('Variables and fit values'),
                                 usertext=_('Parameters')), 1 )
        s.add( setting.Dataset('xData', 'x',
                               descr = _('Variable containing x data to fit'),
                               usertext=_('X dataset')), 2 )
        s.add( setting.Dataset('yData', 'y',
                               descr = _('Variable containing y data to fit'),
                               usertext=_('Y dataset')), 3 )
        s.add( setting.Bool('fitRange', False,
                            descr = _('Fit only the data between the '
                                      'minimum and maximum of the axis for '
                                      'the function variable'),
                            usertext=_('Fit only range')),
               4 )
        s.add( setting.WidgetChoice(
                'outLabel', '',
                descr=_('Write best fit parameters to this text label '
                        'after fitting'),
                widgettypes=('label',),
                usertext=_('Output label')),
               5 )
        s.add( setting.Str('outExpr', '',
                           descr = _('Output best fitting expression'),
                           usertext=_('Output expression')),
               6, readonly=True )
        s.add( setting.Float('chi2', -1,
                             descr = 'Output chi^2 from fitting',
                             usertext=_('Fit &chi;<sup>2</sup>')),
               7, readonly=True )
        s.add( setting.Int('dof', -1,
                           descr = _('Output degrees of freedom from fitting'),
                           usertext=_('Fit d.o.f.')),
               8, readonly=True )
        s.add( setting.Float('redchi2', -1,
                             descr = _('Output reduced-chi-squared from fitting'),
                             usertext=_('Fit reduced &chi;<sup>2</sup>')),
               9, readonly=True )

        f = s.get('function')
        f.newDefault('a + b*x')
        f.descr = _('Function to fit')

        # modify description
        s.get('min').usertext=_('Min. fit range')
        s.get('max').usertext=_('Max. fit range')
Ejemplo n.º 6
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') ) )
Ejemplo n.º 7
0
 def addSettings(klass, s):
     """Construct list of settings."""
     veusz.widgets.ImageFile.addSettings(s)
     s.add(
         setting.Str('dataset',
                     '',
                     descr='Source dataset',
                     usertext='Source dataset'), 0)
     s.add(
         setting.Float('target',
                       0,
                       descr='Target time',
                       usertext='Target time'), 1)
     s.add(
         setting.Str('embeddedDataset',
                     '',
                     descr='Dataset source for embedded image',
                     usertext='Dataset source for embedded image',
                     hidden=True))
     s.add(
         setting.Float('embeddedTarget',
                       0,
                       descr='Target time for embedded image',
                       usertext='Target time for embedded image',
                       hidden=True))
     s.add(
         setting.Str(
             'codec',
             'JPG',
             descr='Image codec',
             usertext='Image codec',
         ))
     s.add(
         setting.BoolSwitch(
             'contour',
             False,
             descr='Contour only',
             usertext='Contour only',
             settingstrue=['penWidth'],
         ))
     s.add(
         setting.Int(
             'penWidth',
             0,
             descr='Pen width',
             usertext='Contour width',
         ))
Ejemplo n.º 8
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')
Ejemplo n.º 9
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 )
Ejemplo n.º 10
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) )
Ejemplo n.º 11
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.º 12
0
    def addSettings(klass, s):
        """Construct list of settings."""
        plotters.GenericPlotter.addSettings(s)

        s.add(
            setting.Dataset('data',
                            '',
                            dimensions=2,
                            descr=_('Dataset to plot'),
                            usertext=_('Dataset')), 0)
        s.add(
            setting.FloatOrAuto('min',
                                'Auto',
                                descr=_('Minimum value of image scale'),
                                usertext=_('Min. value')), 1)
        s.add(
            setting.FloatOrAuto('max',
                                'Auto',
                                descr=_('Maximum value of image scale'),
                                usertext=_('Max. value')), 2)
        s.add(
            setting.Choice('colorScaling',
                           ['linear', 'sqrt', 'log', 'squared'],
                           'linear',
                           descr=_('Scaling to transform numbers to color'),
                           usertext=_('Scaling')), 3)

        s.add(
            setting.Dataset('transparencyData',
                            '',
                            dimensions=2,
                            descr=_('Dataset to use for transparency '
                                    '(0 to 1)'),
                            usertext=_('Transparent data')), 4)

        s.add(
            setting.Colormap('colorMap',
                             'grey',
                             descr=_('Set of colors to plot data with'),
                             usertext=_('Colormap'),
                             formatting=True), 5)
        s.add(
            setting.Bool('colorInvert',
                         False,
                         descr=_('Invert color map'),
                         usertext=_('Invert colormap'),
                         formatting=True), 6)
        s.add(
            setting.Int('transparency',
                        0,
                        descr=_('Transparency percentage'),
                        usertext=_('Transparency'),
                        minval=0,
                        maxval=100,
                        formatting=True), 7)

        s.add(
            setting.Bool('smooth',
                         False,
                         descr=_('Smooth image to display resolution'),
                         usertext=_('Smooth'),
                         formatting=True))