Skip to content

silx.gui.plot.PlotWidget: Added yaxis arcsinh support with matplotlib backend#4306

Closed
EdgarGF93 wants to merge 14 commits into
silx-kit:mainfrom
EdgarGF93:yaxis_arcsinh
Closed

silx.gui.plot.PlotWidget: Added yaxis arcsinh support with matplotlib backend#4306
EdgarGF93 wants to merge 14 commits into
silx-kit:mainfrom
EdgarGF93:yaxis_arcsinh

Conversation

@EdgarGF93
Copy link
Copy Markdown
Contributor

Checklist:


@vallsv
Copy link
Copy Markdown
Contributor

vallsv commented Apr 17, 2025

Nice.

This could also be a good opportunity to rework the backend API with normalization. Because actually, to set linear, we have to set setLog(False).

@EdgarGF93
Copy link
Copy Markdown
Contributor Author

EdgarGF93 commented Apr 17, 2025

I think I'll leave the opengl for somebody else :)

@t20100 t20100 changed the title yaxis arcsinh with matplotlib silx.gui.plot.PlotWidget: Added yaxis arcsinh support with matplotlib backend Apr 17, 2025
Copy link
Copy Markdown
Member

@t20100 t20100 left a comment

Choose a reason for hiding this comment

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

Let's OpenGL support for later.

I also propose to do this PR on adding arcsinh to PlotWidget with matplotlib and keep the QAction for a second one.

Could you add arcsinh scale for x axis as well for consistency?

Comment thread src/silx/gui/plot/backends/BackendOpenGL.py Outdated
</g>
<g id="logGroup">
</g>
<text id="asinhText" x="8.0" y="19" font-weight="bold" font-family="sans-serif" font-size="0.56em">asinh</text>
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.

Could you convert the text to a path so the icon does not rely on system fonts?
If you don't know how to do it, i can show you.

Comment on lines +1324 to +1333
def setYAxisArcsinh(self, flag):
if flag:
self.ax2.set_yscale("asinh")
self.ax.set_yscale("asinh")
return

self.ax2.set_yscale("linear")
self.ax2.yaxis.set_major_formatter(DefaultTickFormatter())
self.ax.set_yscale("linear")
self.ax.yaxis.set_major_formatter(DefaultTickFormatter())
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.

Would be best to change the backend to have a single place where to set scale for yaxis.
I would replace setYAxisLogarithmic and setYAxisArcsinh by a setScale.

The backend are not marked as private with an _ but they should have and we don't keep the compatibility.

Comment thread src/silx/gui/plot/items/axis.py Outdated
Comment on lines +458 to +459
def _internalSetArcsinh(self, flag):
self._getBackend().setYAxisArcsinh(flag)
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.

Same as above, _internalSetLogarithmic and _internalSetArcsinh could be replaced by a _internalSetScale

Comment thread src/silx/gui/plot/PlotWindow.py
@payno
Copy link
Copy Markdown
Member

payno commented Mar 13, 2026

@EdgarGF93 would you have time to have a look at @t20100 review and update the (matplotlib backend) code or do you step down in favor of somone else ?

@EdgarGF93
Copy link
Copy Markdown
Contributor Author

I'll finish it, sorry for letting it for so long

@payno
Copy link
Copy Markdown
Member

payno commented Mar 13, 2026

I'll finish it, sorry for letting it for so long

Don't worry. We are doing some cleanup and we just want to know where we are :)

@EdgarGF93 EdgarGF93 requested a review from t20100 March 13, 2026 14:18
@EdgarGF93
Copy link
Copy Markdown
Contributor Author

EdgarGF93 commented Mar 13, 2026

I leave you @t20100 the part of generating the icons
Still I need to rebase...

@payno
Copy link
Copy Markdown
Member

payno commented Mar 13, 2026

I leave you @t20100 the part of generating the icons

We just added a dependency on https://github.com/spyder-ide/qtawesome which as plenty of nice icon. If you want to decide by yourself ;)

@EdgarGF93
Copy link
Copy Markdown
Contributor Author

I leave you @t20100 the part of generating the icons

We just added a dependency on https://github.com/spyder-ide/qtawesome which as plenty of nice icon. If you want to decide by yourself ;)

sure , let me check

@EdgarGF93 EdgarGF93 mentioned this pull request Mar 13, 2026
1 task
@EdgarGF93
Copy link
Copy Markdown
Contributor Author

EdgarGF93 commented Mar 13, 2026

Continue cherrypicking on #4529

@EdgarGF93 EdgarGF93 closed this Mar 13, 2026
@EdgarGF93 EdgarGF93 mentioned this pull request Mar 13, 2026
1 task
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.

4 participants