Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better control of error bars from Python #3504

Closed
NickDraper opened this issue Mar 16, 2011 · 1 comment
Closed

Better control of error bars from Python #3504

NickDraper opened this issue Mar 16, 2011 · 1 comment
Milestone

Comments

@NickDraper
Copy link
Contributor

From qtiplot handbook:

Error Bars

Having a plot layer l, you can add error bars to a data curve c, named curveName, using the following methods:

err1 = l.addErrorBars(c, Table *t, QString errColName, int type = 1, double width = 1, int capLength = 8, color = Qt.black, throughSymbol = True, minusSide = True, plusSide = True)
err2 = l.addErrorBars(curveName, Table *t, QString errColName, int type = 1, double width = 1, int capLength = 8, color = Qt.black, throughSymbol = True, minusSide = True, plusSide = True)
Each data curve, c, can have attached a list of error bars:

errors = c.errorBarsList()
The properties of an error bar curve can be accesses, via the following methods:

err = c.errorBarsList()[0]
for i in range(0, err.dataSize()):
    print err.errorValue(i)

err.capLength()
err.width()
err.color()
err.direction()
err.xErrors()
err.throughSymbol()
err.plusSide()
err.minusSide()
c = err.masterCurve() # reference to the master curve to which the error bars curve is attached.
err.detachFromMasterCurve() # equivalent to c.removeErrorBars(err)
... and can be modified, via the following methods:

err.setCapLength(12)
err.setWidth(3)
err.setColor(Qt.red)
err.setDirection(ErrorBarsCurve.Vertical)
err.setXErrors(True) # equivalent to err.setDirection(ErrorBarsCurve.Horizontal)
err.drawThroughSymbol(True)
err.drawPlusSide(True)
err.drawMinusSide(False)
err.setMasterCurve(c)
You can remove all error bars attached to a curve using:

c.clearErrorBars()
@NickDraper
Copy link
Contributor Author

This issue was originally trac ticket 2657

@NickDraper NickDraper added this to the Release 2.0 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant