Skip to content

[BUG] Bad values with yscale=:log10 break follow-up plots in GR #3321

@mortenpi

Description

@mortenpi

Details

Plotting bad (negative) values while yscale=:log10 is set with the GR backend breaks the GR output also for future (valid) plots. For an MWE, trying to render the two following plots, this happens:

julia> plot(1:-0.01:-1, yscale=:log10)
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/es5pb/src/ticks.jl:283
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/es5pb/src/ticks.jl:283

plot1

julia> plot(1:10)
GKS: Rectangle definition is invalid in routine SET_VIEWPORT

plot2

Note the missing tick labels etc.

Other notes:

  • I also tried PyPlot, where the first plot just throws an error, and the second plot is fine. I would actually expect GR to simply throw an error as well for the first plot, but instead it actually tries to render it.
  • I usually run into this issue in vscode, where I accidentally plot rubbish (e.g. pass negative values to a log plot) and then all the following plots are not rendering correctly. The only way to get Plots working again is to restart the Julia session (or change backends; but if you change back to GR, it's still broken). For this, as a workaround, is there any way to reset the GR backend or something along those lines?
  • Looks similar to [BUG] Un-recoverable GKS: Rectangle definition is invalid in routine SET_VIEWPORT #2872, but definitely still occurs.

Backends

This bug occurs on ( insert x below )

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

Versions

Plots.jl version: master (v1.10.5+)
Backend version (]st -m): GR v0.54.0, GR_jll v0.53.0+0
Full MWE manifest
Output of versioninfo():

Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-1620 v3 @ 3.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, haswell)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions