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

UnicodePlots: basic quiver and contour support #4031

Merged
merged 6 commits into from
Jan 19, 2022
Merged

Conversation

t-bltg
Copy link
Member

@t-bltg t-bltg commented Jan 12, 2022

Basic quiver and contour support.

quiver (needs JuliaPlots/UnicodePlots.jl#198)

using Plots; unicodeplots()

main() = begin
  x = range(-2, 2, length=8)
  y = range(-1, 1, length=4)

  X = repeat(x, outer = [1, length(y)])'
  Y = repeat(y, outer = [1, length(x)])

  U = .2(X + Y)
  V = .2(Y - X)

  quiver(X[:], Y[:], quiver=(U[:], V[:])) |> display
  return
end

main()

contour (needs JuliaPlots/UnicodePlots.jl#204)

using Plots; unicodeplots()

main() = begin
  x = 1:.5:20
  y = 1:.5:10
  f(x, y) = (3x + y ^ 2) * abs(sin(x) + cos(y))

  X = repeat(x', length(y), 1)
  Y = repeat(y, 1, length(x))
  z = collect(map(f, X, Y))

  contour(x, y, z, c=:grays) |> display
  return
end

main()

Example application on a 2D lid driven cavity problem:
lid

@t-bltg t-bltg marked this pull request as draft January 12, 2022 00:54
@t-bltg t-bltg changed the title UnicodePots: basic quiver support UnicodePlots: basic quiver support Jan 12, 2022
@t-bltg t-bltg changed the title UnicodePlots: basic quiver support UnicodePlots: basic quiver and contour support Jan 12, 2022
@codecov
Copy link

codecov bot commented Jan 19, 2022

Codecov Report

Merging #4031 (6afc454) into master (3313780) will increase coverage by 0.09%.
The diff coverage is 63.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4031      +/-   ##
==========================================
+ Coverage   62.02%   62.11%   +0.09%     
==========================================
  Files          29       29              
  Lines        7258     7286      +28     
==========================================
+ Hits         4502     4526      +24     
- Misses       2756     2760       +4     
Impacted Files Coverage Δ
src/backends.jl 64.60% <ø> (ø)
src/examples.jl 61.76% <ø> (ø)
src/backends/unicodeplots.jl 51.06% <63.15%> (+1.88%) ⬆️
src/pipeline.jl 93.77% <0.00%> (-0.21%) ⬇️
src/backends/gr.jl 88.27% <0.00%> (ø)
src/layouts.jl 66.96% <0.00%> (+1.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3313780...6afc454. Read the comment docs.

@t-bltg t-bltg marked this pull request as ready for review January 19, 2022 15:22
@t-bltg t-bltg merged commit f333cb2 into JuliaPlots:master Jan 19, 2022
@t-bltg t-bltg deleted the quiver branch January 19, 2022 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant