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

[BUG] plot of sinc quite inaccurate #3894

Closed
simeonschaub opened this issue Oct 23, 2021 · 1 comment · Fixed by JuliaPlots/PlotUtils.jl#137
Closed

[BUG] plot of sinc quite inaccurate #3894

simeonschaub opened this issue Oct 23, 2021 · 1 comment · Fixed by JuliaPlots/PlotUtils.jl#137
Labels

Comments

@simeonschaub
Copy link
Contributor

Details

A minimal reproducer is plot(sinc, -40, 40), which results in the following plot:

image

This surprised me quite a bit, since I initially thought my function itself was numerically unstable. I would have expected plot to capture the smaller oscillations outside of [-20, 7] a lot more accurately than it did. I understand there is an inherent tradeoff between accuracy and the number of sample points, but perhaps the default can be tweaked slightly to show more relevant detail in cases like this.

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot x
plotlyjs x
pgfplotsx x
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version: 1.22.6
Backend version: GR 0.61.0
Output of versioninfo():

Julia Version 1.6.3
Commit ae8452a9e0 (2021-09-23 17:34 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen 7 PRO 4750U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, znver2)
Environment:
  JULIA_REVISE_WORKER_ONLY = 1
@mkborregaard
Copy link
Member

This seems to be an issue with PlotUtils.adapted_grid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants