Merge pull request #1743 from Godisemo/pgfplots-1.0

Fix Julia v1.0 deprecations for pgfplots backend
This commit is contained in:
Daniel Schwabeneder 2018-09-14 19:11:23 +02:00 committed by GitHub
commit eaad735d22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,7 +413,7 @@ function pgf_axis(sp::Subplot, letter)
push!(style, string(letter, "tick = {", join(tick_values,","), "}"))
if axis[:showaxis] && axis[:scale] in (:ln, :log2, :log10) && axis[:ticks] == :auto
# wrap the power part of label with }
tick_labels = Vector{String}(length(ticks[2]))
tick_labels = Vector{String}(undef, length(ticks[2]))
for (i, label) in enumerate(ticks[2])
base, power = split(label, "^")
power = string("{", power, "}")
@ -424,7 +424,7 @@ function pgf_axis(sp::Subplot, letter)
tick_labels = ispolar(sp) && letter == :x ? [ticks[2][3:end]..., "0", "45"] : ticks[2]
if axis[:formatter] in (:scientific, :auto)
tick_labels = string.("\$", convert_sci_unicode.(tick_labels), "\$")
tick_labels = replace.(tick_labels, "×", "\\times")
tick_labels = replace.(tick_labels, Ref("×" => "\\times"))
end
push!(style, string(letter, "ticklabels = {", join(tick_labels,","), "}"))
else
@ -563,7 +563,7 @@ function _update_plot_object(plt::Plot{PGFPlotsBackend})
# add the series object to the PGFPlots.Axis
for series in series_list(sp)
push!.(o, pgf_series(sp, series))
push!.(Ref(o), pgf_series(sp, series))
# add series annotations
anns = series[:series_annotations]