Compare commits

...

3 Commits

Author SHA1 Message Date
Thomas Breloff
01b9cc92fd remove mkdir call in tests; closes #397 2016-07-22 11:18:47 -04:00
Thomas Breloff
7a650d918b unicodeplots size fix 2016-07-22 09:45:44 -04:00
Thomas Breloff
b6fa4bcda4 plotly ticks fix 2016-07-21 11:01:04 -04:00
3 changed files with 18 additions and 18 deletions

View File

@ -191,7 +191,7 @@ function plotly_axis(axis::Axis, sp::Subplot)
# ticks
ticks = get_ticks(axis)
if ticks != :auto && ax[:type] != "-"
if ticks != :auto
ttype = ticksType(ticks)
if ttype == :ticks
ax[:tickmode] = "array"

View File

@ -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
function rebuildUnicodePlot!(plt::Plot)
function rebuildUnicodePlot!(plt::Plot, width, height)
plt.o = []
for sp in plt.subplots
@ -57,7 +57,6 @@ function rebuildUnicodePlot!(plt::Plot)
y = Float64[ylim[1]]
# 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
o = UnicodePlots.Plot(x, y, canvas_type;
width = width,
@ -143,20 +142,21 @@ end
# 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]
plt.attr[:size] = div(w, 10), div(h, 20)
plt.attr[:color_palette] = [RGB(0,0,0)]
rebuildUnicodePlot!(plt)
rebuildUnicodePlot!(plt, div(w, 10), div(h, 20))
end
function _writemime(io::IO, ::MIME"text/plain", plt::Plot{UnicodePlotsBackend})
unicodeplots_rebuild(plt)
map(show, plt.o)
nothing
end
function _display(plt::Plot{UnicodePlotsBackend})
unicodeplots_rebuild(plt)
map(show, plt.o)
nothing
end

View File

@ -78,12 +78,12 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, popup = is
png(fn)
end
try
run(`mkdir -p $newdir`)
catch err
display(err)
end
# reffn = joinpath(refdir, "ref$idx.png")
# try
# run(`mkdir -p $newdir`)
# catch err
# display(err)
# end
# # reffn = joinpath(refdir, "ref$idx.png")
# the test
vtest = VisualTest(func, reffn, idx)