Closed
Description
When using categorical data on histogram
an error is being printed.
A = [0 0 1 1 1 0 0 0 0 NaN NaN 1 0 0 0 1 0 1 0 1 0 0 0 1 1 1 1];
C = categorical(A,[1 0 NaN],{'yes','no','undecided'});
histogram(C,'BarWidth',0.2);
fig2plotly();
The previous code prints the following error:
Error using response_handler (line 31)
Expecting (x, y) pairs
Error in makecall (line 32)
response_handler(resp);
Error in plotly (line 28)
response = makecall(args, origin,
structargs);
Error in plotlyfig/plotly (line 437)
args.layout = obj.layout;
Error in fig2plotly (line 49)
p.plotly;
Error in A_histogram (line 49)
fig2plotly();
As the Name-Value argument 'BarWidth'
only works for categorical histograms, this also leads to a disfunction with this argument.
Examples on using categorical data with histogram()
can be found on:
https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.histogram.html#buy5k3l