Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update Winston.jl #312

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Winston.jl
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,13 @@ function _format_ticklabel(x, range=0.; min_pow10=4)
endswith(s, ".0") ? s[1:end-2] : s
end

range(a::Real, b::Real) = (a <= b) ? (ceil(Int, a):floor(Int, b)) :
sym_range(a::Real, b::Real) = (a <= b) ? (ceil(Int, a):floor(Int, b)) :
(floor(Int, a):-1:ceil(Int, b))

function _ticklist_linear(lo, hi, sep, origin=0.)
a = (lo - origin)/sep
b = (hi - origin)/sep
[ origin + i*sep for i in range(a,b) ]
[ origin + i*sep for i in sym_range(a,b) ]
end

function _ticks_default_linear(lim)
Expand All @@ -520,7 +520,7 @@ end
function _ticks_default_log(lim)
a = log10(lim[1])
b = log10(lim[2])
r = range(a, b)
r = sym_range(a, b)
nn = length(r)

if nn >= 10
Expand Down Expand Up @@ -553,7 +553,7 @@ end
function _subticks_log(lim, ticks, num=nothing)
a = log10(lim[1])
b = log10(lim[2])
r = range(a, b)
r = sym_range(a, b)
nn = length(r)

if nn >= 10
Expand Down Expand Up @@ -2863,4 +2863,4 @@ display(::REPL.REPLDisplay, ::MIME"text/plain", p::PlotContainer) = display(_dis

include("precompile.jl")

end # module
end # module