Skip to content

doc: refresh writing_NXdata page and add scatter 3d examples to it#4541

Merged
loichuder merged 1 commit into
mainfrom
scatter-doc
Mar 19, 2026
Merged

doc: refresh writing_NXdata page and add scatter 3d examples to it#4541
loichuder merged 1 commit into
mainfrom
scatter-doc

Conversation

@loichuder
Copy link
Copy Markdown
Member

  • The use of generative AI is disclosed and described (see AI policy)
  • The PR title is formatted as: <Module or Topic>: <Action> <Summary> (see contributing guidelines)
  • Bring code examples up to date (no need for numpy.array(..., dtype=text_dtype))
  • Add 3D scatter example
  • Remove Writing NXdata with silx to make way for more convenient helpers as discussed with @t20100

I did not remove the introductory part about NeXus for now but I think we could trim it down or tie it with the examples.

Comment thread doc/source/Tutorials/writing_NXdata.rst
Comment thread doc/source/Tutorials/writing_NXdata.rst
Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
ds = nxdata.create_dataset("x",
data=numpy.array([101.1, 101.2, 101.3, 101.4]))
ds.attrs["long_name"] = numpy.array("abscissa", dtype=text_dtype)

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.

I feel like something is missing here after the example: either a description of the produced plot or a screenshot of silx view

What do you think?

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.

The corresponding screenshots would be awesome!

Maybe before the code snippet.

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.

It seemed more natural to me to put it after to show the result. Tell me what you think

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.

I was think of a gallery: find the plot you want and then look at how to do it, but it is fine as it is for me!

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.

Ah yes, it could be nice.

Well, one can navigate to the appropriate plot using the sidebar menu since every plot has its own section


import numpy
from silx.io.nxdata import save_NXdata
When producing the 3D scatter plot, ``silx view`` will scale the markers according to the first auxiliary signal.
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.

Documenting #4539

Comment thread doc/source/Tutorials/writing_NXdata.rst
@loichuder loichuder requested a review from t20100 March 17, 2026 08:30
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.

Nice to remove duplicated examples and making each sample code independent.

Adding some screenshots would be awesome!

I did not remove the introductory part about NeXus for now but I think we could trim it down or tie it with the examples.

+1 to strim it down in another PR and refer to nexus documentation and the keep silx specifics which would become more visible.

Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
ds = nxdata.create_dataset("x",
data=numpy.array([101.1, 101.2, 101.3, 101.4]))
ds.attrs["long_name"] = numpy.array("abscissa", dtype=text_dtype)

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.

The corresponding screenshots would be awesome!

Maybe before the code snippet.

Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
@loichuder
Copy link
Copy Markdown
Member Author

So, here are the improvements in this PR after review:

@loichuder
Copy link
Copy Markdown
Member Author

For next PRs:

  • Add an example of RGBA (mention @interpretation)
  • Trim down the NeXus section
  • Document Silx-specific features

Did I miss something @t20100 ?

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.

Nice with the screenshots!

ds = nxdata.create_dataset("x",
data=numpy.array([101.1, 101.2, 101.3, 101.4]))
ds.attrs["long_name"] = numpy.array("abscissa", dtype=text_dtype)

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.

I was think of a gallery: find the plot you want and then look at how to do it, but it is fine as it is for me!

Comment thread doc/source/Tutorials/writing_NXdata.rst Outdated
Comment on lines +310 to +312
If the image axes have the same ``units`` or both have no ``units``, the image aspect ratio will kept.

In the example above, the two axes ``x`` and ``y`` have different ``units`` so that the image aspect ratio is not conserved. No newline at end of file
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.

👍

@loichuder loichuder disabled auto-merge March 19, 2026 15:17
@loichuder loichuder merged commit 0583c7b into main Mar 19, 2026
3 of 4 checks passed
@loichuder loichuder deleted the scatter-doc branch March 19, 2026 15:18
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.

2 participants