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] ylims!() not working for certain plots #327

Closed
kaiwizz opened this issue Sep 23, 2024 · 2 comments
Closed

[BUG] ylims!() not working for certain plots #327

kaiwizz opened this issue Sep 23, 2024 · 2 comments

Comments

@kaiwizz
Copy link

kaiwizz commented Sep 23, 2024

Details

I ran into this issue while creating a certain plot. pgfplotsx() backend successfully generates the initial plot, but when I try to adjust the x and y axis, it gives me an error. This is an example that also shows the same error.

using Plots

pgfplotsx()
scatter(x-> 1e-3/(x-3), 1, 10000)
ylims!(-0.00025,0.00025)

gr()
scatter(x-> 1e-3/(x-3), 1, 10000)
ylims!(-0.00025,0.00025)

the gr() backend can change the y axis but pgfplotsx() does not.

Versions

Plots v1.40.8
PGFPlotsX v1.6.1
Output of versioninfo():

Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =
@KristofferC
Copy link
Owner

Seems like a Plots.jl issue? Or do you have a pure PGFPlotsX.jl reproducer?

@kaiwizz
Copy link
Author

kaiwizz commented Sep 24, 2024

I guess you are right,

using PGFPlotsX

x = range(1, 10000, length = 500) 
@pgf Axis(
    {
        xmajorgrids,
        ymajorgrids,
        ymin= -0.00025,
        ymax = 0.00025
    },
    Plot(
        {
            no_marks,
        },
        Coordinates(x, @. (1e-3) / (x-3))
    )
)

This works as expected.

@kaiwizz kaiwizz closed this as completed Sep 24, 2024
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

No branches or pull requests

2 participants