Implemented camera attribute for PyPlot.

This commit is contained in:
Andrew Palugniok 2017-10-06 20:07:31 +01:00
parent 65a28e76e5
commit 94e79f1e4c

View File

@ -35,6 +35,7 @@ const _pyplot_attr = merge_with_base_supported([
:stride,
:framestyle,
:tick_direction,
:camera,
])
const _pyplot_seriestype = [
:path, :steppre, :steppost, :shape,
@ -1104,6 +1105,13 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
ax[:set_aspect](isa(aratio, Symbol) ? string(aratio) : aratio, anchor = "C")
end
#camera/view angle
if is3d(sp)
#convert azimuthal to match GR behaviour
#view_init(elevation, azimuthal) so reverse :camera args
ax[:view_init]((sp[:camera].-(90,0))[end:-1:1]...)
end
# legend
py_add_legend(plt, sp, ax)