Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 217e67fb7f | |||
| 3053bb4cc2 | |||
| 8dcff1f73d | |||
| c73a5aaabc | |||
| 806d4671ce | |||
| c4a64351ca | |||
| 345bceb526 | |||
| 5673ced5d7 | |||
| a929903a63 | |||
| b9cf8c3928 | |||
| 9b573dce49 | |||
| c2bb17cece | |||
| 7e122bdfea | |||
| 1ee999af33 | |||
| 381f14b657 | |||
| 3fec5ae1cf | |||
| b154a1a3e4 | |||
| cef0a55870 | |||
| 61e80e96cf | |||
| 0db321aecc | |||
| 8b7f87506a | |||
| f9f6e0ff57 | |||
| 6f36d0998f | |||
| 943bdca05e | |||
| bece65e922 | |||
| 2fb315af0e | |||
| 849c2911a7 |
@@ -23,8 +23,7 @@ jobs:
|
||||
version: # NOTE: the versions below should match those in your botconfig
|
||||
- '1.3'
|
||||
- '1.4'
|
||||
- '1.5.0-rc1'
|
||||
- 'nightly'
|
||||
- '1.5'
|
||||
os: # NOTE: should match the os setting of your botconfig
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
name = "Plots"
|
||||
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
author = ["Tom Breloff (@tbreloff)"]
|
||||
version = "1.5.4"
|
||||
version = "1.5.9"
|
||||
|
||||
[deps]
|
||||
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
@@ -33,9 +33,9 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
||||
|
||||
[compat]
|
||||
Contour = "0.5"
|
||||
FFMPEG = "0.2, 0.3"
|
||||
FFMPEG = "0.2, 0.3, 0.4"
|
||||
FixedPointNumbers = "0.6, 0.7, 0.8"
|
||||
GR = "0.46, 0.47, 0.48, 0.49, 0.50"
|
||||
GR = "0.46, 0.47, 0.48, 0.49, 0.50, 0.51"
|
||||
GeometryBasics = "0.2"
|
||||
GeometryTypes = "0.7, 0.8"
|
||||
JSON = "0.21, 1"
|
||||
|
||||
+3
-3
@@ -90,15 +90,15 @@ function buildanimation(anim::Animation, fn::AbstractString,
|
||||
if variable_palette
|
||||
# generate a colorpalette for each frame for highest quality, but larger filesize
|
||||
palette="palettegen=stats_mode=single[pal],[0:v][pal]paletteuse=new=1"
|
||||
ffmpeg_exe(`-v $verbose_level -framerate $framerate -loop $loop -i $(animdir)/%06d.png -lavfi "$palette" -y $fn`)
|
||||
ffmpeg_exe(`-v $verbose_level -framerate $framerate -i $(animdir)/%06d.png -lavfi "$palette" -loop $loop -y $fn`)
|
||||
else
|
||||
# generate a colorpalette first so ffmpeg does not have to guess it
|
||||
ffmpeg_exe(`-v $verbose_level -i $(animdir)/%06d.png -vf "palettegen=stats_mode=diff" -y "$(animdir)/palette.bmp"`)
|
||||
# then apply the palette to get better results
|
||||
ffmpeg_exe(`-v $verbose_level -framerate $framerate -loop $loop -i $(animdir)/%06d.png -i "$(animdir)/palette.bmp" -lavfi "paletteuse=dither=sierra2_4a" -y $fn`)
|
||||
ffmpeg_exe(`-v $verbose_level -framerate $framerate -i $(animdir)/%06d.png -i "$(animdir)/palette.bmp" -lavfi "paletteuse=dither=sierra2_4a" -loop $loop -y $fn`)
|
||||
end
|
||||
else
|
||||
ffmpeg_exe(`-v $verbose_level -framerate $framerate -loop $loop -i $(animdir)/%06d.png -pix_fmt yuv420p -y $fn`)
|
||||
ffmpeg_exe(`-v $verbose_level -framerate $framerate -i $(animdir)/%06d.png -loop $loop -y $fn`)
|
||||
end
|
||||
|
||||
show_msg && @info("Saved animation to ", fn)
|
||||
|
||||
+18
-11
@@ -585,7 +585,7 @@ function gr_legend_pos(sp::Subplot, w, h, viewport_plotarea)
|
||||
# As per https://github.com/jheinen/GR.jl/blob/master/src/jlgr.jl#L525
|
||||
xpos = viewport_plotarea[2] + x_legend_offset + legend_leftw + ymirror * gr_axis_width(sp, sp[:yaxis])
|
||||
else
|
||||
xpos = viewport_plotarea[2] - legend_rightw - legend_textw
|
||||
xpos = viewport_plotarea[2] - legend_rightw - legend_textw - x_legend_offset
|
||||
end
|
||||
elseif occursin("left", str)
|
||||
if occursin("outer", str)
|
||||
@@ -600,7 +600,7 @@ function gr_legend_pos(sp::Subplot, w, h, viewport_plotarea)
|
||||
if s == :outertop
|
||||
ypos = viewport_plotarea[4] + y_legend_offset + legendh + xmirror * gr_axis_height(sp, sp[:xaxis])
|
||||
else
|
||||
ypos = viewport_plotarea[4] - y_legend_offset
|
||||
ypos = viewport_plotarea[4] - y_legend_offset - legend_dy
|
||||
end
|
||||
elseif occursin("bottom", str)
|
||||
if s == :outerbottom
|
||||
@@ -1014,9 +1014,11 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
GR.selntran(1)
|
||||
GR.restorestate()
|
||||
end
|
||||
|
||||
legend_width_factor = (viewport_plotarea[2] - viewport_plotarea[1]) / 45 # Determines the width of legend box
|
||||
legend_textw = legendw
|
||||
legend_rightw = 0.02 # To be made dynamic in a follow up PR
|
||||
legend_leftw = 0.08 # To be made dynamic in a follow up PR
|
||||
legend_rightw = legend_width_factor
|
||||
legend_leftw = legend_width_factor * 4
|
||||
total_legendw = legend_textw + legend_leftw + legend_rightw
|
||||
|
||||
x_legend_offset = (viewport_plotarea[2] - viewport_plotarea[1]) / 30
|
||||
@@ -1025,15 +1027,20 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
dy = gr_point_mult(sp) * sp[:legendfontsize] * 1.75
|
||||
legendh = dy * legendn
|
||||
leg_str = string(sp[:legend])
|
||||
|
||||
xaxis, yaxis = sp[:xaxis], sp[:yaxis]
|
||||
xmirror = xaxis[:guide_position] == :top || (xaxis[:guide_position] == :auto && xaxis[:mirror] == true)
|
||||
ymirror = yaxis[:guide_position] == :right || (yaxis[:guide_position] == :auto && yaxis[:mirror] == true)
|
||||
|
||||
if occursin("outer", leg_str)
|
||||
if occursin("right", leg_str)
|
||||
viewport_plotarea[2] -= total_legendw + x_legend_offset # Lessen plot max width to make space for outer legend
|
||||
viewport_plotarea[2] -= total_legendw + x_legend_offset
|
||||
elseif occursin("left", leg_str)
|
||||
viewport_plotarea[1] += total_legendw + x_legend_offset # Increase plot min width to make space for outer legend
|
||||
viewport_plotarea[1] += total_legendw + x_legend_offset + !ymirror * gr_axis_width(sp, sp[:yaxis])
|
||||
elseif occursin("top", leg_str)
|
||||
viewport_plotarea[4] -= legendh + dy + y_legend_offset
|
||||
elseif occursin("bottom", leg_str)
|
||||
viewport_plotarea[3] += legendh + dy + y_legend_offset
|
||||
viewport_plotarea[3] += legendh + dy + y_legend_offset + !xmirror * gr_axis_height(sp, sp[:xaxis])
|
||||
end
|
||||
end
|
||||
if sp[:legend] == :inline
|
||||
@@ -1880,7 +1887,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
if (st == :shape || series[:fillrange] !== nothing) && series[:ribbon] === nothing
|
||||
fc = get_fillcolor(series, clims)
|
||||
gr_set_fill(fc) #, series[:fillalpha])
|
||||
l, r = xpos-0.07, xpos-0.01
|
||||
l, r = xpos - legend_width_factor * 3.5, xpos - legend_width_factor / 2
|
||||
b, t = ypos-0.4dy, ypos+0.4dy
|
||||
x = [l, r, r, l, l]
|
||||
y = [b, b, t, t, b]
|
||||
@@ -1895,9 +1902,9 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
if st in (:path, :straightline, :path3d)
|
||||
gr_set_transparency(lc, get_linealpha(series))
|
||||
if series[:fillrange] === nothing || series[:ribbon] !== nothing
|
||||
GR.polyline([xpos - 0.07, xpos - 0.01], [ypos, ypos])
|
||||
GR.polyline([xpos - legend_width_factor * 3.5, xpos - legend_width_factor / 2], [ypos, ypos])
|
||||
else
|
||||
GR.polyline([xpos - 0.07, xpos - 0.01], [ypos+0.4dy, ypos+0.4dy])
|
||||
GR.polyline([xpos - legend_width_factor * 3.5, xpos - legend_width_factor / 2], [ypos+0.4dy, ypos+0.4dy])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1910,7 +1917,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
0, 0.8 * sp[:legendfontsize] * msw / 8
|
||||
end
|
||||
gr_draw_markers(
|
||||
series, xpos - 0.035, ypos, clims, s, sw
|
||||
series, xpos - legend_width_factor * 2, ypos, clims, s, sw
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
+10
-16
@@ -83,17 +83,17 @@ function Base.push!(pgfx_plot::PGFPlotsXPlot, item)
|
||||
push!(pgfx_plot.the_plot, item)
|
||||
end
|
||||
|
||||
function pgfx_split_extra_opts(extra)
|
||||
return (get(extra, :add, nothing), filter( x-> first(x) != :add, extra))
|
||||
end
|
||||
function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
if !pgfx_plot.is_created || pgfx_plot.was_shown
|
||||
pgfx_sanitize_plot!(plt)
|
||||
# extract extra kwargs
|
||||
extra_plot_opt = plt[:extra_plot_kwargs]
|
||||
extra_plot = nothing
|
||||
if haskey(extra_plot_opt, :add)
|
||||
extra_plot = wraptuple(pop!(extra_plot_opt,:add))
|
||||
end
|
||||
extra_plot, extra_plot_opt = pgfx_split_extra_opts(plt[:extra_plot_kwargs])
|
||||
the_plot = PGFPlotsX.TikzPicture(PGFPlotsX.Options(extra_plot_opt...))
|
||||
if extra_plot !== nothing
|
||||
extra_plot = wraptuple(extra_plot)
|
||||
push!(the_plot, extra_plot...)
|
||||
end
|
||||
bgc = plt.attr[:background_color_outside] == :match ?
|
||||
@@ -249,13 +249,10 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
else
|
||||
PGFPlotsX.Axis
|
||||
end
|
||||
extra_sp_opt = sp[:extra_kwargs]
|
||||
extra_sp = nothing
|
||||
if haskey(extra_sp_opt, :add)
|
||||
extra_sp = wraptuple(pop!(extra_sp_opt,:add))
|
||||
end
|
||||
extra_sp, extra_sp_opt = pgfx_split_extra_opts(sp[:extra_kwargs])
|
||||
axis = axisf(merge(axis_opt, PGFPlotsX.Options(extra_sp_opt...)))
|
||||
if extra_sp !== nothing
|
||||
extra_sp = wraptuple(extra_sp)
|
||||
push!(axis, extra_sp...)
|
||||
end
|
||||
if sp[:legendtitle] !== nothing
|
||||
@@ -279,11 +276,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
"color" => single_color(opt[:linecolor]),
|
||||
"name path" => string(series_id),
|
||||
)
|
||||
extra_series_opt = series[:extra_kwargs]
|
||||
extra_series = nothing
|
||||
if haskey(extra_series_opt, :add)
|
||||
extra_series = wraptuple(pop!(extra_series_opt,:add))
|
||||
end
|
||||
extra_series, extra_series_opt = pgfx_split_extra_opts(series[:extra_kwargs])
|
||||
series_opt = merge(series_opt, PGFPlotsX.Options(extra_series_opt...))
|
||||
if RecipesPipeline.is3d(series) || st in (:heatmap, :contour)
|
||||
series_func = PGFPlotsX.Plot3
|
||||
@@ -354,7 +347,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
_cycle(sf, rng),
|
||||
rng,
|
||||
)
|
||||
elseif sf isa Tuple
|
||||
elseif sf isa Tuple && series[:ribbon] !== nothing
|
||||
for sfi in sf
|
||||
pgfx_fillrange_series!(
|
||||
axis,
|
||||
@@ -376,6 +369,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
segment_plot =
|
||||
series_func(merge(series_opt, segment_opt), coordinates)
|
||||
if extra_series !== nothing
|
||||
extra_series = wraptuple(extra_series)
|
||||
push!(segment_plot, extra_series...)
|
||||
end
|
||||
push!(axis, segment_plot)
|
||||
|
||||
+27
-14
@@ -23,6 +23,7 @@ pynp."seterr"(invalid="ignore")
|
||||
pytransforms = PyPlot.pyimport("matplotlib.transforms")
|
||||
pycollections = PyPlot.pyimport("matplotlib.collections")
|
||||
pyart3d = PyPlot.art3D
|
||||
pyrcparams = PyPlot.PyDict(PyPlot.matplotlib."rcParams")
|
||||
|
||||
# "support" matplotlib v1.5
|
||||
set_facecolor_sym = if PyPlot.version < v"2"
|
||||
@@ -276,7 +277,6 @@ end
|
||||
function py_bbox_axis(ax, letter)
|
||||
ticks = py_bbox_ticks(ax, letter)
|
||||
labels = py_bbox_axislabel(ax, letter)
|
||||
# letter == "x" && @show ticks labels ticks+labels
|
||||
ticks + labels
|
||||
end
|
||||
|
||||
@@ -728,8 +728,10 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
end
|
||||
|
||||
if st == :image
|
||||
# @show typeof(z)
|
||||
xmin, xmax = ignorenan_extrema(series[:x]); ymin, ymax = ignorenan_extrema(series[:y])
|
||||
xmin, xmax = ignorenan_extrema(series[:x])
|
||||
ymin, ymax = ignorenan_extrema(series[:y])
|
||||
dx = (xmax - xmin) / (length(series[:x]) - 1) / 2
|
||||
dy = (ymax - ymin) / (length(series[:y]) - 1) / 2
|
||||
img = Array(transpose_z(series, z.surf))
|
||||
z = if eltype(img) <: Colors.AbstractGray
|
||||
float(img)
|
||||
@@ -743,7 +745,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
cmap = py_colormap(cgrad(plot_color([:black, :white]))),
|
||||
vmin = 0.0,
|
||||
vmax = 1.0,
|
||||
extent = (xmin-0.5, xmax+0.5, ymax+0.5, ymin-0.5)
|
||||
extent = (xmin - dx, xmax + dx, ymax + dy, ymin - dy)
|
||||
)
|
||||
push!(handles, handle)
|
||||
|
||||
@@ -840,7 +842,9 @@ function py_set_lims(ax, sp::Subplot, axis::Axis)
|
||||
getproperty(ax, Symbol("set_", letter, "lim"))(lfrom, lto)
|
||||
end
|
||||
|
||||
function py_set_ticks(ax, ticks, letter)
|
||||
py_surround_latextext(latexstring, env) = PyPlot.LaTeXStrings.latexstring(env, "{",latexstring[2:end-1],"}")
|
||||
|
||||
function py_set_ticks(ax, ticks, letter, env)
|
||||
ticks == :auto && return
|
||||
axis = getproperty(ax, Symbol(letter,"axis"))
|
||||
if ticks == :none || ticks === nothing || ticks == false
|
||||
@@ -857,7 +861,8 @@ function py_set_ticks(ax, ticks, letter)
|
||||
axis."set_ticks"(ticks)
|
||||
elseif ttype == :ticks_and_labels
|
||||
axis."set_ticks"(ticks[1])
|
||||
axis."set_ticklabels"(ticks[2])
|
||||
tick_labels = [py_surround_latextext(ticklabel, env) for ticklabel in ticks[2]]
|
||||
axis."set_ticklabels"(tick_labels)
|
||||
else
|
||||
error("Invalid input for $(letter)ticks: $ticks")
|
||||
end
|
||||
@@ -1106,7 +1111,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
pyaxis."set_label_position"(axis[:guide_position])
|
||||
end
|
||||
py_set_scale(ax, sp, axis)
|
||||
axis[:ticks] != :native ? py_set_lims(ax, sp, axis) : nothing
|
||||
axis[:ticks] == :native ? nothing : py_set_lims(ax, sp, axis)
|
||||
if ispolar(sp) && letter == :y
|
||||
ax."set_rlabel_position"(90)
|
||||
end
|
||||
@@ -1115,10 +1120,22 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
if sp[:framestyle] == :origin && length(ticks) > 1
|
||||
ticks[2][ticks[1] .== 0] .= ""
|
||||
end
|
||||
axis[:ticks] != :native ? py_set_ticks(ax, ticks, letter) : nothing
|
||||
|
||||
# Set ticks
|
||||
fontProperties = PyPlot.PyCall.PyDict(Dict("family" => axis[:tickfontfamily],
|
||||
"size" => py_thickness_scale(plt, axis[:tickfontsize]),
|
||||
"useTex" => false,
|
||||
"rotation" => axis[:tickfontrotation]))
|
||||
getproperty(ax, Symbol("set_",letter,"ticklabels"))(getproperty(ax, Symbol("get_",letter,"ticks"))(), fontProperties)
|
||||
|
||||
# workaround to set mathtext.fontspec per Text element
|
||||
env = "\\mathregular" # matches the outer fonts https://matplotlib.org/tutorials/text/mathtext.html
|
||||
axis[:ticks] == :native ? nothing : py_set_ticks(ax, ticks, letter, env)
|
||||
|
||||
# Tick marks
|
||||
intensity = 0.5 # This value corresponds to scaling of other grid elements
|
||||
pyaxis."set_tick_params"(direction = axis[:tick_direction] == :out ? "out" : "in", width=py_thickness_scale(plt, intensity))
|
||||
pyaxis."set_tick_params"(direction = axis[:tick_direction] == :out ? "out" : "in", width=py_thickness_scale(plt, intensity),
|
||||
length= 5 * py_thickness_scale(plt, intensity))
|
||||
|
||||
getproperty(ax, Symbol("set_", letter, "label"))(axis[:guide])
|
||||
if get(axis.plotattributes, :flip, false)
|
||||
@@ -1137,11 +1154,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
pyaxis."label"."set_rotation"(axis[:guidefontrotation])
|
||||
end
|
||||
|
||||
for lab in getproperty(ax, Symbol("get_", letter, "ticklabels"))()
|
||||
lab."set_fontsize"(py_thickness_scale(plt, axis[:tickfontsize]))
|
||||
lab."set_family"(axis[:tickfontfamily])
|
||||
lab."set_rotation"(axis[:rotation])
|
||||
end
|
||||
|
||||
if axis[:grid] && !(ticks in (:none, nothing, false))
|
||||
fgcolor = py_color(axis[:foreground_color_grid])
|
||||
pyaxis."grid"(true,
|
||||
|
||||
@@ -885,6 +885,7 @@ const _examples = PlotExample[
|
||||
sv = SVector{10}(rand(10))
|
||||
ov = OffsetVector(rand(10), -2)
|
||||
plot([sv, ov], label = ["StaticArray" "OffsetArray"])
|
||||
plot!(3ov, ribbon=ov, label="OffsetArray ribbon")
|
||||
end
|
||||
end,
|
||||
],
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ function savefig(plt::Plot, fn::AbstractString)
|
||||
fn = abspath(expanduser(fn))
|
||||
|
||||
# get the extension
|
||||
fn, ext = splitext(fn)
|
||||
_, ext = splitext(fn)
|
||||
ext = chop(ext, head = 1, tail = 0)
|
||||
if isempty(ext)
|
||||
ext = defaultOutputFormat(plt)
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ RecipesPipeline.splittable_attribute(plt::Plot, key, val::SeriesAnnotations, len
|
||||
RecipesPipeline.splittable_attribute(plt, key, val.strs, len)
|
||||
|
||||
function RecipesPipeline.split_attribute(plt::Plot, key, val::SeriesAnnotations, indices)
|
||||
split_strs = _RecipesPipeline.split_attribute(key, val.strs, indices)
|
||||
split_strs = RecipesPipeline.split_attribute(key, val.strs, indices)
|
||||
return SeriesAnnotations(split_strs, val.font, val.baseshape, val.scalefactor)
|
||||
end
|
||||
|
||||
|
||||
+6
-6
@@ -126,8 +126,8 @@ isnothing(x) = false
|
||||
_cycle(wrapper::InputWrapper, idx::Int) = wrapper.obj
|
||||
_cycle(wrapper::InputWrapper, idx::AVec{Int}) = wrapper.obj
|
||||
|
||||
_cycle(v::AVec, idx::Int) = v[mod1(idx, length(v))]
|
||||
_cycle(v::AMat, idx::Int) = size(v,1) == 1 ? v[1, mod1(idx, size(v,2))] : v[:, mod1(idx, size(v,2))]
|
||||
_cycle(v::AVec, idx::Int) = v[mod(idx, axes(v,1))]
|
||||
_cycle(v::AMat, idx::Int) = size(v,1) == 1 ? v[end, mod(idx, axes(v,2))] : v[:, mod(idx, axes(v,2))]
|
||||
_cycle(v, idx::Int) = v
|
||||
|
||||
_cycle(v::AVec, indices::AVec{Int}) = map(i -> _cycle(v,i), indices)
|
||||
@@ -362,10 +362,10 @@ end
|
||||
ok(tup::Tuple) = ok(tup...)
|
||||
|
||||
# compute one side of a fill range from a ribbon
|
||||
function make_fillrange_side(y, rib)
|
||||
frs = zeros(length(y))
|
||||
for (i, (yi, ri)) in enumerate(zip(y, Base.Iterators.cycle(rib)))
|
||||
frs[i] = yi + ri
|
||||
function make_fillrange_side(y::AVec, rib)
|
||||
frs = zeros(axes(y))
|
||||
for (i, yi) in pairs(y)
|
||||
frs[i] = yi + _cycle(rib,i)
|
||||
end
|
||||
frs
|
||||
end
|
||||
|
||||
@@ -302,6 +302,11 @@ end
|
||||
lines = readlines(io)
|
||||
@test count(s -> occursin("node", s), lines) == 9
|
||||
end
|
||||
# test .tikz extension
|
||||
file_path =joinpath(path,"annotations.tikz")
|
||||
@test_nowarn savefig(annotation_plot, file_path)
|
||||
@test_nowarn open(file_path) do io
|
||||
end
|
||||
end
|
||||
end # testset
|
||||
@testset "Ribbon" begin
|
||||
@@ -341,4 +346,14 @@ end # testset
|
||||
axes = Plots.pgfx_axes(pl.o)
|
||||
@test !haskey(axes[1].options.dict, "axis line shift")
|
||||
@test haskey(axes[2].options.dict, "axis line shift")
|
||||
pl = plot(x->x, -1:1; add = raw"\node at (0,0.5) {\huge hi};", extra_kwargs = :subplot)
|
||||
@test pl[1][:extra_kwargs] == Dict(:add => raw"\node at (0,0.5) {\huge hi};")
|
||||
Plots._update_plot_object(pl)
|
||||
axes = Plots.pgfx_axes(pl.o)
|
||||
@test filter(x->x isa String, axes[1].contents)[1] == raw"\node at (0,0.5) {\huge hi};"
|
||||
plot!(pl)
|
||||
@test pl[1][:extra_kwargs] == Dict(:add => raw"\node at (0,0.5) {\huge hi};")
|
||||
Plots._update_plot_object(pl)
|
||||
axes = Plots.pgfx_axes(pl.o)
|
||||
@test filter(x->x isa String, axes[1].contents)[1] == raw"\node at (0,0.5) {\huge hi};"
|
||||
end # testset
|
||||
|
||||
Reference in New Issue
Block a user