pgfplots aspect_ratio

This commit is contained in:
Thomas Breloff 2016-05-11 09:18:40 -04:00
parent 90c2202f6e
commit 44d1cdc2b2

View File

@ -2,6 +2,7 @@
supportedArgs(::PGFPlotsBackend) = [ supportedArgs(::PGFPlotsBackend) = [
# :annotation, # :annotation,
:aspect_ratio,
# :axis, # :axis,
:background_color, :background_color,
# :color_palette, # :color_palette,
@ -339,11 +340,15 @@ function _pgfplots_get_axis_kwargs(d)
axisargs[:ymax] = d[:ylims][2] axisargs[:ymax] = d[:ylims][2]
end end
if d[:grid] == true if d[:grid] == true
axisargs[:style] *= "grid = major" axisargs[:style] *= "grid = major,"
elseif d[:grid] == false elseif d[:grid] == false
end end
if d[:aspect_ratio] == :equal || d[:aspect_ratio] == 1
axisargs[:axisEqual] = "true"
end
if ((d[:legend] != :none) || (d[:legend] != :best)) && (d[:legend] in keys(_pgfplots_legend_pos)) if ((d[:legend] != :none) || (d[:legend] != :best)) && (d[:legend] in keys(_pgfplots_legend_pos))
axisargs[:legendPos] = _pgfplots_legend_pos[d[:legend]] axisargs[:legendPos] = _pgfplots_legend_pos[d[:legend]]
end end