pgfplots fixes
This commit is contained in:
parent
05fa4a92de
commit
d64d3ef101
@ -132,7 +132,7 @@ function pgf_marker(d::KW)
|
||||
cstr, a = pgf_color(d[:markercolor], d[:markeralpha])
|
||||
cstr_stroke, a_stroke = pgf_color(d[:markerstrokecolor], d[:markerstrokealpha])
|
||||
"""
|
||||
mark = $(get(_pgfplots_markers, shape, "o*")),
|
||||
mark = $(get(_pgfplots_markers, shape, "*")),
|
||||
mark size = $(0.5 * d[:markersize]),
|
||||
mark options = {
|
||||
color = $cstr_stroke, draw opacity = $a_stroke,
|
||||
@ -160,7 +160,7 @@ function pgf_series(sp::Subplot, series::Series)
|
||||
end
|
||||
|
||||
# add to legend?
|
||||
if sp.attr[:legend] != :none && should_add_to_legend(series)
|
||||
if sp[:legend] != :none && should_add_to_legend(series)
|
||||
kw[:legendentry] = d[:label]
|
||||
end
|
||||
|
||||
@ -198,7 +198,7 @@ end
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
function pgf_axis(sp::Subplot, letter)
|
||||
axis = sp.attr[Symbol(letter,:axis)]
|
||||
axis = sp[Symbol(letter,:axis)]
|
||||
style = []
|
||||
kw = KW()
|
||||
|
||||
@ -250,19 +250,19 @@ function _make_pgf_plot!(plt::Plot)
|
||||
yshift = $((height(bb) - (bottom(bb))).value)mm,
|
||||
width = $(width(bb).value)mm,
|
||||
height = $(height(bb).value)mm,
|
||||
axis background/.style={fill=$(pgf_color(sp.attr[:background_color_inside])[1])}
|
||||
axis background/.style={fill=$(pgf_color(sp[:background_color_inside])[1])}
|
||||
""")
|
||||
|
||||
if sp.attr[:title] != ""
|
||||
push!(style, "title = $(sp.attr[:title])")
|
||||
if sp[:title] != ""
|
||||
push!(style, "title = $(sp[:title])")
|
||||
end
|
||||
|
||||
sp.attr[:grid] && push!(style, "grid = major")
|
||||
if sp.attr[:aspect_ratio] in (1, :equal)
|
||||
sp[:grid] && push!(style, "grid = major")
|
||||
if sp[:aspect_ratio] in (1, :equal)
|
||||
kw[:axisEqual] = "true"
|
||||
end
|
||||
|
||||
legpos = sp.attr[:legend]
|
||||
legpos = sp[:legend]
|
||||
if haskey(_pgfplots_legend_pos, legpos)
|
||||
kw[:legendPos] = _pgfplots_legend_pos[legpos]
|
||||
end
|
||||
|
||||
@ -82,8 +82,8 @@ end
|
||||
function rebuildUnicodePlot!(plt::Plot)
|
||||
plt.o = []
|
||||
for sp in plt.subplots
|
||||
xaxis = sp.attr[:xaxis]
|
||||
yaxis = sp.attr[:yaxis]
|
||||
xaxis = sp[:xaxis]
|
||||
yaxis = sp[:yaxis]
|
||||
xlim = axis_limits(xaxis)
|
||||
ylim = axis_limits(yaxis)
|
||||
|
||||
@ -97,11 +97,11 @@ 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.attr[:size]
|
||||
width, height = plt[:size]
|
||||
o = UnicodePlots.Plot(x, y;
|
||||
width = width,
|
||||
height = height,
|
||||
title = sp.attr[:title],
|
||||
title = sp[:title],
|
||||
xlim = xlim,
|
||||
ylim = ylim
|
||||
)
|
||||
@ -112,7 +112,7 @@ function rebuildUnicodePlot!(plt::Plot)
|
||||
|
||||
# now use the ! functions to add to the plot
|
||||
for series in series_list(sp)
|
||||
addUnicodeSeries!(o, series.d, sp.attr[:legend] != :none, xlim, ylim)
|
||||
addUnicodeSeries!(o, series.d, sp[:legend] != :none, xlim, ylim)
|
||||
end
|
||||
|
||||
# save the object
|
||||
@ -246,9 +246,11 @@ end
|
||||
|
||||
function _create_backend_figure(plt::Plot{UnicodePlotsBackend})
|
||||
# do we want to give a new default size?
|
||||
if !haskey(plt.attr, :size) || plt.attr[:size] == default(:size)
|
||||
plt.attr[:size] = (60,20)
|
||||
end
|
||||
# if !haskey(plt.attr, :size) || plt.attr[:size] == default(:size)
|
||||
# plt.attr[:size] = (60,20)
|
||||
# end
|
||||
w, h = plt[:size]
|
||||
plt.attr[:size] = div(w, 10), div(h, 20)
|
||||
plt.attr[:color_palette] = [RGB(0,0,0)]
|
||||
nothing
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user