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

GR: expose surface(...) display options, fix hardcoded constants #3591

Merged
merged 2 commits into from
Jul 4, 2021

Conversation

t-bltg
Copy link
Member

@t-bltg t-bltg commented Jul 1, 2021

This PR add:

  1. Expose the options described in GR surface's table;
  2. Add the possibility to override hardcoded nx and ny when re-griding.

NOTES:

  • name used: :display_option is arbitrary, maybe there is a better naming ?
  • using series[:extra_kwargs] seems appropriate since this is specific to the GR backend
  • should we document this or not ?

mwe

using Plots; gr()
import GR

main() = begin
  meshgrid(x, y) = (ones(eltype(y), length(y)) * x', y * ones(eltype(x), length(x))')

  x, y = meshgrid(-2:.25:2, -2:.25:2)
  f = x .* exp.(-x.^2 - y.^2)

  surface(x[:], y[:], f[:], display_option=GR.OPTION_SHADED_MESH, nx=50, ny=50, legend=:none, c=:viridis)
  return
end

main()

without PR

pr2_ex-WITHOUT

with PR

pr2_ex-WITH

@codecov
Copy link

codecov bot commented Jul 1, 2021

Codecov Report

Merging #3591 (094b9f8) into master (bba971f) will decrease coverage by 0.08%.
The diff coverage is 87.50%.

❗ Current head 094b9f8 differs from pull request most recent head e42b4ad. Consider uploading reports for the commit e42b4ad to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3591      +/-   ##
==========================================
- Coverage   65.12%   65.03%   -0.09%     
==========================================
  Files          27       27              
  Lines        6660     6663       +3     
==========================================
- Hits         4337     4333       -4     
- Misses       2323     2330       +7     
Impacted Files Coverage Δ
src/backends/gr.jl 88.65% <87.50%> (+0.03%) ⬆️
src/axes.jl 83.56% <0.00%> (-0.47%) ⬇️
src/recipes.jl 57.75% <0.00%> (-0.46%) ⬇️
src/layouts.jl 68.06% <0.00%> (-0.25%) ⬇️

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 bba971f...e42b4ad. Read the comment docs.

@t-bltg t-bltg changed the title GR: expose surface(...) display options GR: expose surface(...) display options, fix hardcoded constants Jul 1, 2021
@BeastyBlacksmith
Copy link
Member

Thats all fine and should definitely be documented in the GR backend section.

t-bltg added a commit to t-bltg/PlotDocs.jl that referenced this pull request Jul 1, 2021
t-bltg added a commit to t-bltg/PlotDocs.jl that referenced this pull request Jul 1, 2021
BeastyBlacksmith pushed a commit to JuliaPlots/PlotDocs.jl that referenced this pull request Jul 2, 2021
* update docs for JuliaPlots/Plots.jl/pull/3591

* md table with description

* specify series type

Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
@t-bltg t-bltg merged commit 3f110d6 into JuliaPlots:master Jul 4, 2021
@t-bltg t-bltg mentioned this pull request Jul 6, 2021
1 task
BeastyBlacksmith pushed a commit to JuliaPlots/PlotDocs.jl that referenced this pull request Jun 7, 2022
* update docs for JuliaPlots/Plots.jl/pull/3591

* md table with description

* specify series type

Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
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.

None yet

2 participants