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

Axes in images generated by Trixi2Img are inverted and unlabeled #213

Closed
efaulhaber opened this issue Oct 10, 2020 · 3 comments · Fixed by trixi-framework/Trixi2Img.jl#19
Assignees

Comments

@efaulhaber
Copy link
Member

efaulhaber commented Oct 10, 2020

The axes seem to be inverted in every image. For example here is the generated image for the output of

Trixi.run("examples/2d/parameters.toml", n_steps_max=1, initial_conditions="initial_conditions_linear_x",
    boundary_conditions="boundary_conditions_linear_x", periodicity=false)

in ParaView:
grafik
and in Trixi2Img:
solution_000000_scalar
Furthermore the axes should be labeled in Trixi2Img (especially for 3d data).
We should also think about adding the slice plane to 3d images, so it's always clear at which plane we are looking.

@efaulhaber
Copy link
Member Author

I dug a little and found that this is due to the contourf function from Plots itself.
When the plot is built from a matrix the first matrix dimension corresponds to the y-axis while the second matrix dimension corresponds to the x-axis.

If I transpose the matrix first, I will get the correct image.
I am not sure if this is the correct fix here, but I created a pull request that does exactly this.

@ranocha
Copy link
Member

ranocha commented Oct 11, 2020

Thanks for catching that! Yeah, it's always annoying to have to switch dimensions in such plots. I've left some comments in our Slack conversation.

@efaulhaber
Copy link
Member Author

efaulhaber commented Oct 11, 2020

Thank you. So the correct fix would be to call contourf with match_dimensions=true. I will create a new pull request once trixi-framework/Trixi2Img.jl#18 is merged as this PR is based on it (axis labels for 3d slices require different logic).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants