Skip to content

Commit d6a28fe

Browse files
committed
Fixed #30: axis scale widget was sometimes not aligned with canvas grid
1 parent 74a23d7 commit d6a28fe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

qwt/plot.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,14 @@ def updateAxes(self):
896896
scaleWidget = self.axisWidget(axisId)
897897
scaleWidget.setScaleDiv(d.scaleDiv)
898898

899-
#TODO: see when it is *really* necessary to update border dist
900-
# startDist, endDist = scaleWidget.getBorderDistHint()
901-
# scaleWidget.setBorderDist(startDist, endDist)
899+
# It is *really* necessary to update border dist!
900+
# Otherwise, when tick labels are large enough, the ticks
901+
# may not be aligned with canvas grid.
902+
# See the following issues for more details:
903+
# https://github.com/PierreRaybaut/guiqwt/issues/57
904+
# https://github.com/PierreRaybaut/PythonQwt/issues/30
905+
startDist, endDist = scaleWidget.getBorderDistHint()
906+
scaleWidget.setBorderDist(startDist, endDist)
902907

903908
for item in itmList:
904909
if item.testItemInterest(QwtPlotItem.ScaleInterest):

0 commit comments

Comments
 (0)