Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filled patches in PlotWindow #4202

Closed
kklmn opened this issue Jan 15, 2025 · 1 comment
Closed

filled patches in PlotWindow #4202

kklmn opened this issue Jan 15, 2025 · 1 comment

Comments

@kklmn
Copy link

kklmn commented Jan 15, 2025

Hello silx'ers!

I want to add a collection of rectangular patches to a 1D silx plot, as shown below by the red bands that mark monochromator glitches. I can plot a horizontal segment with addCurve() and fill the rectangle under it by fill=True.

Q1: Is there a simple way to also have the fill above the segment? I would want a band spanning the whole plot height.

Q2: Can a collection of rectangular patches be generated without adding curves?

image

Thank you in advance!

@kklmn
Copy link
Author

kklmn commented Jan 19, 2025

I got the rectangles by plot.addShape() and setting ± very big y coordinates. And the whole point is that the rectangles do not affect the plot view maximizing. When I need to remove them I do

    for item in plot.getItems():
        if item.getName().startswith('glitch'):  # they were named with legend=f'glitch{ipeak}'
            plot.removeItem(item)

The only thing I can't solve is the forced dotted hatch pattern. I hope you know why you did it.

Image

@kklmn kklmn closed this as completed Jan 19, 2025
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

No branches or pull requests

1 participant