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

plotting numbers on small scale: no y-axis ticks and warning No strict ticks found #2309

Closed
floswald opened this issue Dec 5, 2019 · 4 comments

Comments

@floswald
Copy link
Contributor

floswald commented Dec 5, 2019

hi there

I found this:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Plots

julia> y = vcat( 0.26884394967432595,
        0.26882576785614415,
        0.26880758603796234,
        0.2687894042197805 ,
        0.2687712224015987 ,
        0.26875304058341687,
        0.26873485876523506,
        0.26871667694705326,
        0.2686984951288714 ,
        0.2686803133106896 )
10-element Array{Float64,1}:
 0.26884394967432595
 0.26882576785614415
 0.26880758603796234
 0.2687894042197805 
 0.2687712224015987 
 0.26875304058341687
 0.26873485876523506
 0.26871667694705326
 0.2686984951288714 
 0.2686803133106896 

julia> plot(y)
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168

test

it seems as if there is a minimum required delta between vector entries or the ticks fail.

julia> y2
2-element Array{Float64,1}:
 0.26884394967432595
 0.2686803133106896 

julia> scatter(y2)
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/EybJR/src/ticks.jl:168

scy2

julia> y3
2-element Array{Float64,1}:
 0.27   
 0.26868

julia> scatter(y3)

scy3

julia> y4
2-element Array{Float64,1}:
 0.269  
 0.26868

julia> scatter(y4)

scy4

@floswald floswald changed the title plotting small numbers: no y-axis ticks and warning No strict ticks found plotting numbers on small scale: no y-axis ticks and warning No strict ticks found Dec 6, 2019
@daschw
Copy link
Member

daschw commented Jan 14, 2020

Thanks for reporting! This is probably fixed in JuliaPlots/PlotUtils.jl#77.

@floswald
Copy link
Contributor Author

indeed! thanks!

@Vilin97
Copy link

Vilin97 commented Jan 26, 2024

I am still seeing this error

julia> x
10-element Vector{Float64}:
 -4.2500725161431774e-17
 -7.37257477290143e-18
 -4.0766001685454967e-17
 -2.0816681711721685e-17
  0.0
  5.724587470723463e-17
  1.8214596497756474e-17
 -2.949029909160572e-17
  1.3877787807814457e-17
  3.642919299551295e-17

julia> plot(x)
┌ Warning: No strict ticks found
└ @ PlotUtils C:\Users\Vasily\.julia\packages\PlotUtils\jEGKP\src\ticks.jl:191
┌ Warning: No strict ticks found
└ @ PlotUtils C:\Users\Vasily\.julia\packages\PlotUtils\jEGKP\src\ticks.jl:191

image

@Vilin97
Copy link

Vilin97 commented Jan 26, 2024

Interestingly, if the values are exactly equal, the ticks are fine. But when there is a small (<1e-15) separation, ticks fail.

julia> plot(rand(10) .* 1e-15)
┌ Warning: No strict ticks found
└ @ PlotUtils C:\Users\Vasily\.julia\packages\PlotUtils\jEGKP\src\ticks.jl:191
┌ Warning: No strict ticks found
└ @ PlotUtils C:\Users\Vasily\.julia\packages\PlotUtils\jEGKP\src\ticks.jl:191

julia> plot(ones(10) .* 1e-15) # no error

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

3 participants