Axis line can optionally stop at the last tick
This commit is contained in:
parent
829503f3d2
commit
ee89b291dc
@ -383,6 +383,7 @@ class AxisItem(GraphicsWidget):
|
||||
picture = QtGui.QPicture()
|
||||
painter = QtGui.QPainter(picture)
|
||||
specs = self.generateDrawSpecs(painter)
|
||||
if specs is not None:
|
||||
self.drawPicture(painter, *specs)
|
||||
finally:
|
||||
painter.end()
|
||||
@ -646,6 +647,10 @@ class AxisItem(GraphicsWidget):
|
||||
|
||||
## determine mapping between tick values and local coordinates
|
||||
dif = self.range[1] - self.range[0]
|
||||
if dif == 0:
|
||||
xscale = 1
|
||||
offset = 0
|
||||
else:
|
||||
if axis == 0:
|
||||
xScale = -bounds.height() / dif
|
||||
offset = self.range[0] * xScale - bounds.height()
|
||||
|
Loading…
Reference in New Issue
Block a user