default to a bar width of _bar_width for bar plots with only one data point

This commit is contained in:
Daniel Schwabeneder 2018-02-26 10:03:02 +01:00
parent 32e1536955
commit a7a5fe36f9

View File

@ -317,7 +317,11 @@ end
# compute half-width of bars # compute half-width of bars
bw = plotattributes[:bar_width] bw = plotattributes[:bar_width]
hw = if bw == nothing hw = if bw == nothing
0.5*_bar_width*ignorenan_minimum(filter(x->x>0, diff(procx))) if nx > 1
0.5*_bar_width*ignorenan_minimum(filter(x->x>0, diff(procx)))
else
0.5 * _bar_width
end
else else
Float64[0.5_cycle(bw,i) for i=1:length(procx)] Float64[0.5_cycle(bw,i) for i=1:length(procx)]
end end