pyplot support for pie charts
This commit is contained in:
parent
5dfd3d2f5d
commit
982a512ebd
@ -189,8 +189,8 @@ vline(args...; kw...) = plot(args...; kw..., linetype = :vline)
|
|||||||
vline!(args...; kw...) = plot!(args...; kw..., linetype = :vline)
|
vline!(args...; kw...) = plot!(args...; kw..., linetype = :vline)
|
||||||
ohlc(args...; kw...) = plot(args...; kw..., linetype = :ohlc)
|
ohlc(args...; kw...) = plot(args...; kw..., linetype = :ohlc)
|
||||||
ohlc!(args...; kw...) = plot!(args...; kw..., linetype = :ohlc)
|
ohlc!(args...; kw...) = plot!(args...; kw..., linetype = :ohlc)
|
||||||
pie(args...; kw...) = plot(args...; kw..., linetype = :pie)
|
pie(args...; kw...) = plot(args...; kw..., linetype = :pie, aspect_ratio = :equal, grid=false, xticks=nothing, yticks=nothing)
|
||||||
pie!(args...; kw...) = plot!(args...; kw..., linetype = :pie)
|
pie!(args...; kw...) = plot!(args...; kw..., linetype = :pie, aspect_ratio = :equal, grid=false, xticks=nothing, yticks=nothing)
|
||||||
contour(args...; kw...) = plot(args...; kw..., linetype = :contour)
|
contour(args...; kw...) = plot(args...; kw..., linetype = :contour)
|
||||||
contour!(args...; kw...) = plot!(args...; kw..., linetype = :contour)
|
contour!(args...; kw...) = plot!(args...; kw..., linetype = :contour)
|
||||||
contour3d(args...; kw...) = plot(args...; kw..., linetype = :contour3d)
|
contour3d(args...; kw...) = plot(args...; kw..., linetype = :contour3d)
|
||||||
|
|||||||
@ -581,6 +581,15 @@ function _add_series(pkg::PyPlotBackend, plt::Plot, d::KW)
|
|||||||
push!(handles, handle)
|
push!(handles, handle)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if lt == :pie
|
||||||
|
handle = ax[:pie](y;
|
||||||
|
# label = d[:label],
|
||||||
|
# colors = # a vector of colors?
|
||||||
|
labels = x
|
||||||
|
)
|
||||||
|
push!(handles, handle)
|
||||||
|
end
|
||||||
|
|
||||||
d[:serieshandle] = handles
|
d[:serieshandle] = handles
|
||||||
|
|
||||||
# smoothing
|
# smoothing
|
||||||
@ -944,7 +953,7 @@ function addPyPlotLegend(plt::Plot, ax)
|
|||||||
args = filter(x -> !(x[:linetype] in (
|
args = filter(x -> !(x[:linetype] in (
|
||||||
:hist,:density,:hexbin,:hist2d,:hline,:vline,
|
:hist,:density,:hexbin,:hist2d,:hline,:vline,
|
||||||
:contour,:contour3d,:surface,:wireframe,
|
:contour,:contour3d,:surface,:wireframe,
|
||||||
:heatmap,:path3d,:scatter3d
|
:heatmap,:path3d,:scatter3d, :pie
|
||||||
)), plt.seriesargs)
|
)), plt.seriesargs)
|
||||||
args = filter(x -> x[:label] != "", args)
|
args = filter(x -> x[:label] != "", args)
|
||||||
if length(args) > 0
|
if length(args) > 0
|
||||||
|
|||||||
@ -111,7 +111,7 @@ supportedTypes(::PyPlotBackend) = [
|
|||||||
:none, :line, :path, :steppre, :steppost, :shape,
|
:none, :line, :path, :steppre, :steppost, :shape,
|
||||||
:scatter, :hist2d, :hexbin, :hist, :density,
|
:scatter, :hist2d, :hexbin, :hist, :density,
|
||||||
:bar, :sticks, :box, :violin, :quiver,
|
:bar, :sticks, :box, :violin, :quiver,
|
||||||
:hline, :vline, :heatmap,
|
:hline, :vline, :heatmap, :pie,
|
||||||
:contour, :contour3d, :path3d, :scatter3d, :surface, :wireframe
|
:contour, :contour3d, :path3d, :scatter3d, :surface, :wireframe
|
||||||
]
|
]
|
||||||
supportedStyles(::PyPlotBackend) = [:auto, :solid, :dash, :dot, :dashdot]
|
supportedStyles(::PyPlotBackend) = [:auto, :solid, :dash, :dot, :dashdot]
|
||||||
|
|||||||
@ -167,7 +167,7 @@ function _add_series(plt::Plot, d::KW, ::Void, args...;
|
|||||||
for (i,di) in enumerate(seriesArgList)
|
for (i,di) in enumerate(seriesArgList)
|
||||||
plt.n += 1
|
plt.n += 1
|
||||||
|
|
||||||
if !stringsSupported()
|
if !stringsSupported() && di[:linetype] != :pie
|
||||||
setTicksFromStringVector(d, di, :x, :xticks)
|
setTicksFromStringVector(d, di, :x, :xticks)
|
||||||
setTicksFromStringVector(d, di, :y, :yticks)
|
setTicksFromStringVector(d, di, :y, :yticks)
|
||||||
setTicksFromStringVector(d, di, :z, :zticks)
|
setTicksFromStringVector(d, di, :z, :zticks)
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
typealias FuncOrFuncs @compat(Union{Function, AVec{Function}})
|
typealias FuncOrFuncs @compat(Union{Function, AVec{Function}})
|
||||||
|
|
||||||
all3D(d::KW) = trueOrAllTrue(lt -> lt in (:contour, :heatmap, :surface, :wireframe), get(d, :linetype, :none))
|
all3D(d::KW) = trueOrAllTrue(lt -> lt in (:contour, :heatmap, :surface, :wireframe, :contour3d), get(d, :linetype, :none))
|
||||||
|
|
||||||
# missing
|
# missing
|
||||||
convertToAnyVector(v::@compat(Void), d::KW) = Any[nothing], nothing
|
convertToAnyVector(v::@compat(Void), d::KW) = Any[nothing], nothing
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user