def __init__(self, *args, **argsv): axis.TickLabel.__init__(self, *args, **argsv) self.remove('offset') self.remove('rotate') self.remove('hide') self.add( setting.Bool('hideradial', False, descr=_('Hide radial labels'), usertext=_('Hide radial'))) self.add( setting.Bool('hidetangential', False, descr=_('Hide tangential labels'), usertext=_('Hide tangent')))
def __init__(self, parent, name=None): veusz.widgets.BoxShape.__init__(self, parent, name=name) if type(self) == DataPoint: self.readDefaults() self.addAction( veusz.widgets.widget.Action('up', self.actionUp, descr='Update Data Point', usertext='Update Data Point')) self.addAction( veusz.widgets.widget.Action('removeGaps', self.removeGaps, descr='Remove Gaps', usertext='Remove Gaps')) self.settings.Fill.add( setting.Bool( 'extended_clicakble_area', True, descr= _('If enabled, datapoint is easier to select, but can create problems when printing.' ), usertext=_('Extend clickable area')))
def addSettings(klass, s): """Construct list of settings.""" BoxShape.addSettings(s) s.add(setting.ImageFilename('filename', '', descr=_('Image filename'), usertext=_('Filename'), formatting=False), posn=0) s.add( setting.Str('embeddedImageData', '', descr=_('Embedded base 64-encoded image data, ' 'used if filename set to {embedded}'), usertext=_('Embedded data'), hidden=True)) s.add(setting.Bool('aspect', True, descr=_('Preserve aspect ratio'), usertext=_('Preserve aspect'), formatting=True), posn=0) s.Border.get('hide').newDefault(True)
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 __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')
def addSettings(klass, s): """Construct list of settings.""" veusz.widgets.Line.addSettings(s) s.add( setting.Bool('showLabels', True, descr='Show Labels', usertext='Show datapoint labels', formatting=True), 1) s.add( setting.Str('labelText', '%(xlabel)s=%(x)i \\\\%(ylabel)s=%(y)E', descr='Output labels text', usertext='Output labels text'), 2)
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))
def __init__(self, name, **args): setting.Brush.__init__(self, name, **args) self.get('color').newDefault(setting.Reference('../PlotLine/color')) self.add( setting.Colormap( 'colorMap', 'grey', descr=_('If color markers dataset is given, use this colormap ' 'instead of the fill color'), usertext=_('Color map'), formatting=True)) self.add( setting.Bool('colorMapInvert', False, descr=_('Invert color map'), usertext=_('Invert map'), formatting=True))
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.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') ) )
def addSettings(klass, s): widget.Widget.addSettings(s) s.remove('hide') s.add( setting.DistancePhysical('width', '15cm', descr=_('Width of the pages'), usertext=_('Page width'), formatting=True)) s.add( setting.DistancePhysical('height', '15cm', descr=_('Height of the pages'), usertext=_('Page height'), formatting=True)) s.add( setting.Bool('englishlocale', False, descr=_('Use US/English number formatting for ' 'document'), usertext=_('English locale'), formatting=True))
def addSettings(klass, s): """Add items to settings s.""" s.add( setting.Bool('hide', False, descr = _('Hide object'), usertext = _('Hide'), formatting = True) )
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.""" 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))
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)
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')