Added support for :nbins keyword
This commit is contained in:
parent
42a175bd53
commit
b6334176e4
@ -260,7 +260,11 @@ function gr_display(plt::Plot{GRBackend}, clear=true, update=true,
|
|||||||
elseif lt == :ohlc
|
elseif lt == :ohlc
|
||||||
x, y = 1:size(p[:y], 1), p[:y]
|
x, y = 1:size(p[:y], 1), p[:y]
|
||||||
elseif lt in [:hist, :density]
|
elseif lt in [:hist, :density]
|
||||||
|
if haskey(p, :bins)
|
||||||
|
x, y = Base.hist(p[:y], p[:bins])
|
||||||
|
else
|
||||||
x, y = Base.hist(p[:y])
|
x, y = Base.hist(p[:y])
|
||||||
|
end
|
||||||
elseif lt in [:hist2d, :hexbin]
|
elseif lt in [:hist2d, :hexbin]
|
||||||
E = zeros(length(p[:x]),2)
|
E = zeros(length(p[:x]),2)
|
||||||
E[:,1] = p[:x]
|
E[:,1] = p[:x]
|
||||||
@ -516,7 +520,11 @@ function gr_display(plt::Plot{GRBackend}, clear=true, update=true,
|
|||||||
GR.fillrect(i-0.4, i+0.4, max(0, ymin), y[i])
|
GR.fillrect(i-0.4, i+0.4, max(0, ymin), y[i])
|
||||||
end
|
end
|
||||||
elseif lt in [:hist, :density]
|
elseif lt in [:hist, :density]
|
||||||
|
if haskey(p, :bins)
|
||||||
|
h = Base.hist(p[:y], p[:bins])
|
||||||
|
else
|
||||||
h = Base.hist(p[:y])
|
h = Base.hist(p[:y])
|
||||||
|
end
|
||||||
x, y = float(collect(h[1])), float(h[2])
|
x, y = float(collect(h[1])), float(h[2])
|
||||||
for i = 2:length(y)
|
for i = 2:length(y)
|
||||||
GR.setfillcolorind(gr_getcolorind(p[:fillcolor]))
|
GR.setfillcolorind(gr_getcolorind(p[:fillcolor]))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user