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

Warn on extrakws #4861

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

isentropic
Copy link
Member

Description

Consider a case from https://docs.juliaplots.org/stable/backends/#Fine-tuning

x = range(-3, 3, length=30)
surface(
  x, x, (x, y)->exp(-x^2 - y^2), c=:viridis, legend=:none,
  nx=50, ny=50, display_option=Plots.GR.OPTION_SHADED_MESH,  # <-- series[:extra_kwargs]
)

Upon mispelling of any kws it is interpretted as an extra_kw which leads to silent ignoring of kws:

# before
plot(rand(10), newweirdarg=true)

just plots.
Now it outputs:

 Warning: Extra keyword argument newweirdarg not explicitly supported with Plots.GRBackend().  Choose from: legend_hfactor, legend_wfactor, nx, ny, display_option
└ @ Plots ~/Projects/Plots.jl/src/args.jl:1564

Granted this is a crutch as I just look over a list of predefined kws, but in principle this mechanism could be more sophisiticated per backend. What you think?

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

1 participant