Skip to content

Commit

Permalink
Pass rbody through interp2d
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2004y committed Oct 8, 2024
1 parent d81266c commit c66d0c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Batsrus"
uuid = "e74ebddf-6ac1-4047-a0e5-c32c99e57753"
authors = ["Hongyang Zhou <[email protected]>"]
version = "0.6.4"
version = "0.6.5"

[deps]
FortranFiles = "c58ffaec-ab22-586d-bfc5-781a99fd0b10"
Expand Down
20 changes: 12 additions & 8 deletions src/plot/pyplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,9 @@ end
Wrapper over `contour` in matplotlib.
"""
function PyPlot.contour(bd::BATLData{2, T}, var::AbstractString, ax=nothing; levels=0,
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, kwargs...) where T
Xi, Yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask)
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, rbody=1.0,
kwargs...) where T
Xi, Yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask, rbody)
if isnothing(ax) ax = plt.gca() end

if levels != 0
Expand All @@ -502,8 +503,9 @@ end
Wrapper over `contourf` in matplotlib. See [`interp2d`](@ref) for some related keywords.
"""
function PyPlot.contourf(bd::BATLData{2, T}, var::AbstractString, ax=nothing; levels::Int=0,
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, kwargs...) where T
Xi, Yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask)
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, rbody=1.0,
kwargs...) where T
Xi, Yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask, rbody)
if isnothing(ax) ax = plt.gca() end

if levels != 0
Expand Down Expand Up @@ -576,8 +578,9 @@ end
Wrapper over `plot_surface` in matplotlib.
"""
function PyPlot.plot_surface(bd::BATLData{2, T}, var::AbstractString;
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, kwargs...) where T
xi, yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask)
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, rbody=1.0,
kwargs...) where T
xi, yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask, rbody)
Xi, Yi = meshgrid(xi, yi)

plot_surface(Xi, Yi, Wi; kwargs...)
Expand All @@ -591,8 +594,9 @@ end
Wrapper over `pcolormesh` in matplotlib.
"""
function PyPlot.pcolormesh(bd::BATLData{2, T}, var::AbstractString, ax=nothing;
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, kwargs...) where T
xi, yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask)
plotrange=[-Inf,Inf,-Inf,Inf], plotinterval=0.1, innermask=false, rbody=1.0,
kwargs...) where T
xi, yi, Wi = interp2d(bd, var, plotrange, plotinterval; innermask, rbody)

if isnothing(ax) ax = plt.gca() end

Expand Down

2 comments on commit c66d0c3

@henry2004y
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/116839

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.5 -m "<description of version>" c66d0c342753aad32203ac101f7b0d6fe8918d58
git push origin v0.6.5

Please sign in to comment.