Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01b9cc92fd | ||
|
|
7a650d918b | ||
|
|
b6fa4bcda4 |
@ -191,7 +191,7 @@ function plotly_axis(axis::Axis, sp::Subplot)
|
|||||||
|
|
||||||
# ticks
|
# ticks
|
||||||
ticks = get_ticks(axis)
|
ticks = get_ticks(axis)
|
||||||
if ticks != :auto && ax[:type] != "-"
|
if ticks != :auto
|
||||||
ttype = ticksType(ticks)
|
ttype = ticksType(ticks)
|
||||||
if ttype == :ticks
|
if ttype == :ticks
|
||||||
ax[:tickmode] = "array"
|
ax[:tickmode] = "array"
|
||||||
|
|||||||
@ -38,7 +38,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
# do all the magic here... build it all at once, since we need to know about all the series at the very beginning
|
# do all the magic here... build it all at once, since we need to know about all the series at the very beginning
|
||||||
function rebuildUnicodePlot!(plt::Plot)
|
function rebuildUnicodePlot!(plt::Plot, width, height)
|
||||||
plt.o = []
|
plt.o = []
|
||||||
|
|
||||||
for sp in plt.subplots
|
for sp in plt.subplots
|
||||||
@ -57,7 +57,6 @@ function rebuildUnicodePlot!(plt::Plot)
|
|||||||
y = Float64[ylim[1]]
|
y = Float64[ylim[1]]
|
||||||
|
|
||||||
# create a plot window with xlim/ylim set, but the X/Y vectors are outside the bounds
|
# create a plot window with xlim/ylim set, but the X/Y vectors are outside the bounds
|
||||||
width, height = plt[:size]
|
|
||||||
canvas_type = isijulia() ? UnicodePlots.AsciiCanvas : UnicodePlots.BrailleCanvas
|
canvas_type = isijulia() ? UnicodePlots.AsciiCanvas : UnicodePlots.BrailleCanvas
|
||||||
o = UnicodePlots.Plot(x, y, canvas_type;
|
o = UnicodePlots.Plot(x, y, canvas_type;
|
||||||
width = width,
|
width = width,
|
||||||
@ -143,20 +142,21 @@ end
|
|||||||
|
|
||||||
# we don't do very much for subplots... just stack them vertically
|
# we don't do very much for subplots... just stack them vertically
|
||||||
|
|
||||||
function _update_plot_object(plt::Plot{UnicodePlotsBackend})
|
function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
||||||
w, h = plt[:size]
|
w, h = plt[:size]
|
||||||
plt.attr[:size] = div(w, 10), div(h, 20)
|
|
||||||
plt.attr[:color_palette] = [RGB(0,0,0)]
|
plt.attr[:color_palette] = [RGB(0,0,0)]
|
||||||
rebuildUnicodePlot!(plt)
|
rebuildUnicodePlot!(plt, div(w, 10), div(h, 20))
|
||||||
end
|
end
|
||||||
|
|
||||||
function _writemime(io::IO, ::MIME"text/plain", plt::Plot{UnicodePlotsBackend})
|
function _writemime(io::IO, ::MIME"text/plain", plt::Plot{UnicodePlotsBackend})
|
||||||
|
unicodeplots_rebuild(plt)
|
||||||
map(show, plt.o)
|
map(show, plt.o)
|
||||||
nothing
|
nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function _display(plt::Plot{UnicodePlotsBackend})
|
function _display(plt::Plot{UnicodePlotsBackend})
|
||||||
|
unicodeplots_rebuild(plt)
|
||||||
map(show, plt.o)
|
map(show, plt.o)
|
||||||
nothing
|
nothing
|
||||||
end
|
end
|
||||||
|
|||||||
@ -78,12 +78,12 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = is
|
|||||||
png(fn)
|
png(fn)
|
||||||
end
|
end
|
||||||
|
|
||||||
try
|
# try
|
||||||
run(`mkdir -p $newdir`)
|
# run(`mkdir -p $newdir`)
|
||||||
catch err
|
# catch err
|
||||||
display(err)
|
# display(err)
|
||||||
end
|
# end
|
||||||
# reffn = joinpath(refdir, "ref$idx.png")
|
# # reffn = joinpath(refdir, "ref$idx.png")
|
||||||
|
|
||||||
# the test
|
# the test
|
||||||
vtest = VisualTest(func, reffn, idx)
|
vtest = VisualTest(func, reffn, idx)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user