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

Fix bug with plotting multiple figures #121

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Oct 11, 2024

closes #112 - For the functions _geomakie_plot_on_globe!, heatmap2D!, and line_plot1D!, you cannot initialize multiple figures and use these functions afterward as you get the error "LoadError: There is no current axis to plot into". To fix this, we initialize an Axis object in the function and use that for plotting.

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.13%. Comparing base (7fe2021) to head (1372fb2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #121   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files          11       11           
  Lines        1071     1071           
=======================================
  Hits         1051     1051           
  Misses         20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sbozzolo
Copy link
Member

@AlexisRenchon can you have a look at this? I don't know if it has side effects

@AlexisRenchon
Copy link
Member

@AlexisRenchon can you have a look at this? I don't know if it has side effects

this looks great to me, it's better to name fig and axis and clearly add content to them.

I know that a while ago (years ago) it was not possible to have multiple figure open in Makie (e.g., fig and fig1 like your test), maybe they added that by now, which would be great... that was an annoying limitation... did the test pass?

For the functions `_geomakie_plot_on_globe!`, `heatmap2D!`, and
`line_plot1D!`, you cannot initialize multiple figures and use these
functions afterward as you get the error "LoadError: There is no current
axis to plot into". To fix this, we initialize an `Axis` object in the
function and use that for plotting.
@ph-kev
Copy link
Member Author

ph-kev commented Oct 11, 2024

@AlexisRenchon can you have a look at this? I don't know if it has side effects

this looks great to me, it's better to name fig and axis and clearly add content to them.

I know that a while ago (years ago) it was not possible to have multiple figure open in Makie (e.g., fig and fig1 like your test), maybe they added that by now, which would be great... that was an annoying limitation... did the test pass?

Yes, the tests passed.

@ph-kev ph-kev merged commit b8be735 into CliMA:main Oct 11, 2024
9 checks passed
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.

Plot with functions that use _geomakie_plot_on_globe! with multiple figures
3 participants