JuliaPlots/Plots.jl

PGFPlotsX cannot set ylims for certain plots

Open

#4,990 创建于 2024年9月24日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Julia (1,943 star) (381 fork)batch import
PGFPlotsXgood first issue

描述

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 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.

I faced no issue setting the ylims while using purely PGFPlotsX,

using PGFPlotsX

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

Backends

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

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 =

贡献者指南