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 χ<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 χ<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')
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) )
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', ))
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')))
def addSettings(klass, s): """Construct list of settings.""" plotters.FreePlotter.addSettings(s) s.add( setting.DatasetOrStr('label', '', descr=_('Text to show or text dataset'), usertext=_('Label'), datatype='text'), 0) s.add( setting.AlignHorz('alignHorz', 'left', descr=_('Horizontal alignment of label'), usertext=_('Horz alignment'), formatting=True), 7) s.add( setting.AlignVert('alignVert', 'bottom', descr=_('Vertical alignment of label'), usertext=_('Vert alignment'), formatting=True), 8) s.add( setting.Float('angle', 0., descr=_('Angle of the label in degrees'), usertext=_('Angle'), formatting=True), 9) s.add( setting.Bool('clip', False, descr=_('Clip text to its container'), usertext=_('Clip'), formatting=True), 10) s.add(setting.Text('Text', descr=_('Text settings'), usertext=_('Text')), pixmap='settings_axislabel')
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') ) )
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) )
def addSettings(klass, s): """Construct list of settings.""" veusz.widgets.BoxShape.addSettings(s) s.add( setting.Float('remove_gaps_range', 100, descr="Remove gaps range", usertext="Remove gaps range"), 1) s.add( setting.Float('remove_gaps_thershold', 10, descr="Remove gaps thershold", usertext="Remove gaps thershold"), 2) s.add( setting.ChoiceSwitch( 'search', [ 'Nearest (Fixed X)', 'Nearest', 'Maximum', 'Minimum', 'Inflection', 'Stationary', 'None' ], 'Nearest (Fixed X)', settingstrue=['searchRange', 'critical_x'], settingsfalse=[], showfn=lambda val: not val.startswith('Nearest'), descr='Search nearest critical point', usertext='Search nearest'), 4) s.add( setting.Float('searchRange', 10, descr='Critical search range', usertext='Search range'), 5) s.add( setting.Dataset('critical_x', '', descr='Critical search X dataset', usertext='Critical X'), 6) s.add( setting.WidgetChoice( 'secondPoint', '', descr='Second Data Point for passing-through line placement.', widgettypes=('datapoint', ), usertext='Second Data Point'), 7) s.add( setting.WidgetChoice( 'pt2ptLine', '', descr= 'Dispose this line as passing through this and second data point.', widgettypes=('datapointline', ), usertext='Passing-through Line'), 8) # OVERRIDES n = setting.Choice('positioning', ['axes'], 'axes', descr='Axes positioning', usertext='Position mode', formatting=False) n.parent = s s.setdict['positioning'] = n n = setting.DatasetExtended( 'width', [0.04], descr='List of fractional widths or dataset', usertext='Widths', formatting=False) n.parent = s s.setdict['width'] = n n = setting.DatasetExtended( 'height', [0.04], descr='List of fractional heights or dataset', usertext='Heights', formatting=False) n.parent = s s.setdict['height'] = n # FORMATTING s.add( setting.Marker('marker', 'linecross', descr='Type of marker to plot', usertext='Marker', formatting=True), 0) s.add( setting.BoolSwitch('showLabel', True, descr='Show Label', usertext='Show Label', settingstrue=['labelText', 'coordLabel'], formatting=True), 1) s.add( setting.Str('labelText', '%(xlabel)s=%(x)i \\\\%(ylabel)s=%(y)E', descr='Output label text', usertext='Output label text', formatting=True), 2) s.add( setting.WidgetChoice('coordLabel', '', descr='Write coordinates to this label.', widgettypes=('datapointlabel', ), usertext='Coord. label', formatting=True), 3) s.add( setting.BoolSwitch('showTangent', False, descr='Show Tangent', usertext='Show tangent line', settingstrue=['tangentLine'], formatting=True), 4) s.add( setting.WidgetChoice( 'tangentLine', '', descr='Dispose this line as tangent to curve xy.', widgettypes=('datapointline', ), usertext='Tangent Line', formatting=True), 5) s.add( setting.BoolSwitch('showPerpendicular', False, descr='Show Perpend.', usertext='Show perpendicular line', settingstrue=['perpendicularLine'], formatting=True), 6) s.add( setting.WidgetChoice( 'perpendicularLine', '', descr='Dispose this line as perpendicular to curve xy.', widgettypes=('datapointline', ), usertext='Perpendicular Line', formatting=True), 7)
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' )
def addSettings(klass, s): """Construct list of settings.""" GenericPlotter.addSettings(s) # get rid of default key setting s.remove('key') s.add( setting.Strings('keys', ('', ), descr=_('Key text for each dataset'), usertext=_('Key text')), 0) s.add( setting.DatasetOrStr('labels', '', descr=_('Dataset or string to label bars'), usertext=_('Labels'), datatype='text'), 5) s.add( setting.Choice('mode', ('grouped', 'stacked', 'stacked-area'), 'grouped', descr=_('Show datasets grouped ' 'together or as a single bar'), usertext=_('Mode')), 0) s.add( setting.Choice('direction', ('horizontal', 'vertical'), 'vertical', descr=_('Horizontal or vertical bar chart'), usertext=_('Direction')), 0) s.add( setting.Dataset('posn', '', descr=_('Dataset containing position of bars' ' (optional)'), usertext=_('Positions')), 0) s.add( setting.Datasets('lengths', ('y', ), descr=_('Datasets containing lengths of bars'), usertext=_('Lengths')), 0) s.add( setting.Float('barfill', 0.75, minval=0., maxval=1., descr=_('Filling fraction of bars' ' (between 0 and 1)'), usertext=_('Bar fill'), formatting=True)) s.add( setting.Float('groupfill', 0.9, minval=0., maxval=1., descr=_('Filling fraction of groups of bars' ' (between 0 and 1)'), usertext=_('Group fill'), formatting=True)) s.add( setting.Choice('errorstyle', ('none', 'bar', 'barends'), 'bar', descr=_('Error bar style to show'), usertext=_('Error style'), formatting=True)) s.add(BarFill('BarFill', descr=_('Bar fill'), usertext=_('Fill')), pixmap='settings_bgfill') s.add(BarLine('BarLine', descr=_('Bar line'), usertext=_('Line')), pixmap='settings_border') s.add(setting.ErrorBarLine('ErrorBarLine', descr=_('Error bar line settings'), usertext=_('Error bar line')), pixmap='settings_ploterrorline')
def addSettings(klass, s): '''Construct list of settings.''' NonOrthGraph.addSettings(s) s.add( setting.Choice('mode', ('percentage', 'fraction'), 'percentage', descr=_('Show percentages or fractions'), usertext=_('Mode')) ) s.add( setting.Choice('coords', ('bottom-left', 'bottom-right', 'left-bottom', 'left-right', 'right-left', 'right-bottom'), 'bottom-left', descr=_('Axes to use for plotting coordinates'), usertext=_('Coord system')) ) s.add( setting.Str('labelbottom', '', descr=_('Bottom axis label text'), usertext=_('Label bottom')) ) s.add( setting.Str('labelleft', '', descr=_('Left axis label text'), usertext=_('Label left')) ) s.add( setting.Str('labelright', '', descr=_('Right axis label text'), usertext=_('Label right')) ) s.add( setting.Float('originleft', 0., descr=_('Fractional origin of left axis at its top'), usertext=_('Left origin')) ) s.add( setting.Float('originbottom', 0., descr=_('Fractional origin of bottom axis at its left'), usertext=_('Bottom origin')) ) s.add( setting.Float('fracsize', 1., descr=_('Fractional size of plot'), usertext=_('Size')) ) 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' ) s.get('leftMargin').newDefault('1cm') s.get('rightMargin').newDefault('1cm') s.get('topMargin').newDefault('1cm') s.get('bottomMargin').newDefault('1cm') s.MajorTicks.get('number').newDefault(10) s.MinorTicks.get('number').newDefault(50) s.GridLines.get('hide').newDefault(False) s.TickLabels.remove('rotate')
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')