animation default file tempname; raised group warning to 100; check for empty vec in axis; use command_idx for slicing; move deletion of smooth outside loop

This commit is contained in:
Thomas Breloff 2016-06-16 10:03:01 -04:00
parent ec826fc8ce
commit c38e947dc6
4 changed files with 15 additions and 10 deletions

View File

@ -24,7 +24,7 @@ immutable AnimatedGif
filename::Compat.ASCIIString
end
function gif(anim::Animation, fn = "tmp.gif"; fps::Integer = 20)
function gif(anim::Animation, fn = tempname()*".gif"; fps::Integer = 20)
fn = abspath(fn)
try

View File

@ -712,7 +712,7 @@ end
function extractGroupArgs(v::AVec, args...)
groupLabels = sort(collect(unique(v)))
n = length(groupLabels)
if n > 20
if n > 100
warn("You created n=$n groups... Is that intended?")
end
groupIds = Vector{Int}[filter(i -> v[i] == glab, 1:length(v)) for glab in groupLabels]

View File

@ -952,7 +952,10 @@ function py_compute_axis_minval(axis::Axis)
minval = 1.0
sp = axis.sp
for series in series_list(axis.sp)
minval = min(minval, minimum(abs(series.d[axis[:letter]])))
v = series.d[axis[:letter]]
if !isempty(v)
minval = min(minval, minimum(abs(v)))
end
end
# now if the axis limits go to a smaller abs value, use that instead

View File

@ -337,9 +337,6 @@ function _plot!(plt::Plot, d::KW, args...)
:label => "",
:primary => false,
)))
# don't allow something else to handle it
d[:smooth] = false
end
else
@ -349,6 +346,9 @@ function _plot!(plt::Plot, d::KW, args...)
end
end
# don't allow something else to handle it
d[:smooth] = false
# merge in anything meant for plot/subplot/axis
for kw in kw_list
for (k,v) in kw
@ -405,13 +405,15 @@ function _plot!(plt::Plot, d::KW, args...)
# we'll keep a map of subplot to an attribute override dict.
# any series which belong to that subplot
sp_attrs = Dict{Subplot,Any}()
for (i,kw) in enumerate(kw_list)
for kw in kw_list
# get the Subplot object to which the series belongs
sp = get(kw, :subplot, :auto)
command_idx = kw[:series_plotindex] - kw_list[1][:series_plotindex] + 1
sp = if sp == :auto
mod1(i,length(plt.subplots))
cycle(plt.subplots, command_idx)
# mod1(command_idx, length(plt.subplots))
else
slice_arg(sp, i)
slice_arg(sp, command_idx)
end
sp = kw[:subplot] = get_subplot(plt, sp)
# idx = get_subplot_index(plt, sp)
@ -452,7 +454,7 @@ function _plot!(plt::Plot, d::KW, args...)
# this is it folks!
# TODO: we probably shouldn't use i for tracking series index, but rather explicitly track it in recipes
for (i,kw) in enumerate(kw_list)
for kw in kw_list
command_idx = kw[:series_plotindex] - kw_list[1][:series_plotindex] + 1
# # get the Subplot object to which the series belongs