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:
parent
ec826fc8ce
commit
c38e947dc6
@ -24,7 +24,7 @@ immutable AnimatedGif
|
|||||||
filename::Compat.ASCIIString
|
filename::Compat.ASCIIString
|
||||||
end
|
end
|
||||||
|
|
||||||
function gif(anim::Animation, fn = "tmp.gif"; fps::Integer = 20)
|
function gif(anim::Animation, fn = tempname()*".gif"; fps::Integer = 20)
|
||||||
fn = abspath(fn)
|
fn = abspath(fn)
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@ -712,7 +712,7 @@ end
|
|||||||
function extractGroupArgs(v::AVec, args...)
|
function extractGroupArgs(v::AVec, args...)
|
||||||
groupLabels = sort(collect(unique(v)))
|
groupLabels = sort(collect(unique(v)))
|
||||||
n = length(groupLabels)
|
n = length(groupLabels)
|
||||||
if n > 20
|
if n > 100
|
||||||
warn("You created n=$n groups... Is that intended?")
|
warn("You created n=$n groups... Is that intended?")
|
||||||
end
|
end
|
||||||
groupIds = Vector{Int}[filter(i -> v[i] == glab, 1:length(v)) for glab in groupLabels]
|
groupIds = Vector{Int}[filter(i -> v[i] == glab, 1:length(v)) for glab in groupLabels]
|
||||||
|
|||||||
@ -952,7 +952,10 @@ function py_compute_axis_minval(axis::Axis)
|
|||||||
minval = 1.0
|
minval = 1.0
|
||||||
sp = axis.sp
|
sp = axis.sp
|
||||||
for series in series_list(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
|
end
|
||||||
|
|
||||||
# now if the axis limits go to a smaller abs value, use that instead
|
# now if the axis limits go to a smaller abs value, use that instead
|
||||||
|
|||||||
16
src/plot.jl
16
src/plot.jl
@ -337,9 +337,6 @@ function _plot!(plt::Plot, d::KW, args...)
|
|||||||
:label => "",
|
:label => "",
|
||||||
:primary => false,
|
:primary => false,
|
||||||
)))
|
)))
|
||||||
|
|
||||||
# don't allow something else to handle it
|
|
||||||
d[:smooth] = false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -349,6 +346,9 @@ function _plot!(plt::Plot, d::KW, args...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# don't allow something else to handle it
|
||||||
|
d[:smooth] = false
|
||||||
|
|
||||||
# merge in anything meant for plot/subplot/axis
|
# merge in anything meant for plot/subplot/axis
|
||||||
for kw in kw_list
|
for kw in kw_list
|
||||||
for (k,v) in kw
|
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.
|
# we'll keep a map of subplot to an attribute override dict.
|
||||||
# any series which belong to that subplot
|
# any series which belong to that subplot
|
||||||
sp_attrs = Dict{Subplot,Any}()
|
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
|
# get the Subplot object to which the series belongs
|
||||||
sp = get(kw, :subplot, :auto)
|
sp = get(kw, :subplot, :auto)
|
||||||
|
command_idx = kw[:series_plotindex] - kw_list[1][:series_plotindex] + 1
|
||||||
sp = if sp == :auto
|
sp = if sp == :auto
|
||||||
mod1(i,length(plt.subplots))
|
cycle(plt.subplots, command_idx)
|
||||||
|
# mod1(command_idx, length(plt.subplots))
|
||||||
else
|
else
|
||||||
slice_arg(sp, i)
|
slice_arg(sp, command_idx)
|
||||||
end
|
end
|
||||||
sp = kw[:subplot] = get_subplot(plt, sp)
|
sp = kw[:subplot] = get_subplot(plt, sp)
|
||||||
# idx = get_subplot_index(plt, sp)
|
# idx = get_subplot_index(plt, sp)
|
||||||
@ -452,7 +454,7 @@ function _plot!(plt::Plot, d::KW, args...)
|
|||||||
|
|
||||||
# this is it folks!
|
# this is it folks!
|
||||||
# TODO: we probably shouldn't use i for tracking series index, but rather explicitly track it in recipes
|
# 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
|
command_idx = kw[:series_plotindex] - kw_list[1][:series_plotindex] + 1
|
||||||
|
|
||||||
# # get the Subplot object to which the series belongs
|
# # get the Subplot object to which the series belongs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user