Skip to content

Conversation

@jokasimr
Copy link
Contributor

Fixes #128

kwargs.setdefault('grid', True)
return pp.imagefigure(*(pp.Node(h) for h in hs), **kwargs)
p = pp.imagefigure(*(pp.Node(h) for h in hs), **kwargs)
p.ax.invert_yaxis()
Copy link
Member

Choose a reason for hiding this comment

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

Instead of relying on a matplotlib function, can you transpose h to be the right shape?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean by reversing the z_index coord in the data arrays?
Why is that better? This is purely a issue of presentation and it makes sense to keep that in the plotting layer.

Copy link
Member

@jl-wynen jl-wynen Mar 11, 2025

Choose a reason for hiding this comment

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

Oh, right, I misunderstood 'inverting' as 'switching axes'.

Why is that better?

So it doesn't depend on matplotlib but also works with other backends.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it doesn't depend on matplotlib but also works with other backends.

That makes sense.

I'll see if I can get the same result by modifying the coords.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this figure type flipping the array does not flip the axis.
If we want to make this work with other backends we probably need to add that functionality to plopp.

@jokasimr jokasimr merged commit 6297177 into main Mar 11, 2025
4 checks passed
@jokasimr jokasimr deleted the invert-yaxis branch March 11, 2025 12:17
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.

In z-index figure flip y-axis

3 participants