Skip to content

silx.gui.plot: Added highlight of axes offset value#4346

Merged
t20100 merged 5 commits intosilx-kit:mainfrom
t20100:highlight-offset
Mar 10, 2026
Merged

silx.gui.plot: Added highlight of axes offset value#4346
t20100 merged 5 commits intosilx-kit:mainfrom
t20100:highlight-offset

Conversation

@t20100
Copy link
Copy Markdown
Member

@t20100 t20100 commented Jun 27, 2025

Checklist:


This MR highlights the offset text of the axes:

image

Alternative to #4030

@t20100 t20100 added this to the Next major release milestone Jun 27, 2025
@t20100 t20100 requested a review from vallsv June 27, 2025 14:37
@t20100 t20100 force-pushed the highlight-offset branch from 09fca9f to 5366cbb Compare June 30, 2025 11:11
@t20100 t20100 force-pushed the highlight-offset branch from 5366cbb to f3c2a13 Compare July 8, 2025 13:51
@t20100 t20100 requested review from loichuder and payno February 12, 2026 15:56
Comment on lines +320 to +325
pointSize = orderAndOffsetFont.pointSizeF()
if pointSize > 0:
orderAndOffsetFont.setPointSizeF(1.2 * pointSize)
pixelSize = orderAndOffsetFont.pixelSize()
if pixelSize > 0:
orderAndOffsetFont.setPixelSize(int(1.2 * pixelSize))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Perhaps worth abstracting in a helper of some sort setBoldFont or?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The font size can be defined either in pixels or in points, so one or the other is -1 and the other is set.
I'll move this to a helper with some explanation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh I see ! Thanks for the explanation !

@t20100 t20100 closed this Feb 13, 2026
@t20100 t20100 deleted the highlight-offset branch February 13, 2026 11:20
@t20100 t20100 restored the highlight-offset branch February 13, 2026 11:20
@t20100 t20100 reopened this Feb 13, 2026
@t20100 t20100 requested a review from loichuder February 13, 2026 12:45
Copy link
Copy Markdown
Member

@payno payno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me.

Here is a small piece of code to reproduce the plot because this was not straightforward to me how to process this part:

from silx.gui import qt
from silx.gui.plot import Plot1D

app = qt.QApplication([])

widget = Plot1D()
widget.getXAxis().setLimits(-1e6, 1e6)
widget.getYAxis().setLimits(-1e6, 1e6)

widget.show()
app.exec()

Comment thread src/silx/gui/plot/backends/glutils/GLPlotFrame.py Outdated
@t20100 t20100 force-pushed the highlight-offset branch from 762c84c to 95691df Compare March 9, 2026 16:09
@t20100 t20100 merged commit eeedc9a into silx-kit:main Mar 10, 2026
3 of 4 checks passed
@t20100 t20100 deleted the highlight-offset branch March 10, 2026 10:16
@t20100 t20100 mentioned this pull request Mar 10, 2026
2 tasks
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

Successfully merging this pull request may close these issues.

3 participants