Skip to content

Makie extension v2 #174

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

Merged
merged 13 commits into from
Jan 26, 2025
Merged

Makie extension v2 #174

merged 13 commits into from
Jan 26, 2025

Conversation

vchuravy
Copy link
Contributor

@vchuravy vchuravy commented Jan 14, 2025

Builds on #145

Confirmed that it works for a band and line plot I had around.
Will upload some examples later.

Close #145.

@giordano
Copy link
Member

I'd be happy to bump minimum Julia version to v1.10 if that helps with maintenance

Copy link

codecov bot commented Jan 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.51%. Comparing base (0063930) to head (bb21e2f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #174      +/-   ##
==========================================
- Coverage   94.61%   94.51%   -0.11%     
==========================================
  Files          14       15       +1     
  Lines         762      766       +4     
==========================================
+ Hits          721      724       +3     
- Misses         41       42       +1     

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

@vchuravy
Copy link
Contributor Author

Examples:

data = Measurements.measurement.(collect(1:10), randn(10))
scatter(data)

display

errorbars(1:10, data)

display

band(1:10, data)

display

@giordano giordano merged commit ac5f583 into JuliaPhysics:master Jan 26, 2025
9 of 10 checks passed
@giordano
Copy link
Member

Thanks!

@giordano
Copy link
Member

This is in v2.12.0

@giordano giordano linked an issue Feb 15, 2025 that may be closed by this pull request
@icweaver
Copy link

This is amazing, thanks so much for this! I was going to open a quick PR to support this case for errorbars as well:

x = measurement.(1:5, 1:5)
y = x .^ 2
errorbars(x, y)

but noticed in the tests comments that this case was intentionally left ambiguous. Does this break something upstream if

Makie.convert_arguments(P::Type{<:Errorbars}, x::AbstractVector{<:Measurement}, y::AbstractVector{<:Measurement}) =
    Makie.convert_arguments(P, value.(x), value.(y), uncertainty.(y))

is added?

@icweaver
Copy link

Then again, I guess I'm probably showing my bias by wanting to prefer y errorbars over x errorbars for the default case

@cgarling
Copy link

If both x and y are vectors of measurements then I would expect both axes to have error bars but it looks like makie only supports one or the other (direction=:x or direction=:y). When providing both x and y as vectors of measurements I would expect a plot like the following which presently does not seem supported at the library level.

scatter plot with x and y errors

@icweaver
Copy link

icweaver commented Feb 17, 2025

Right, that's why I was being biased and defaulting to the y direction for right now. Getting both would probably have to be done at the full recipe level, or defining a separate "myerrorbars" function, but idk how general that would be

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.

Integration with Makie
5 participants