Bar plot of categorical data
1 vue (au cours des 30 derniers jours)
I have a small column vector (46x1). Each row has a number (0-7), where each number encodes a specific electrode location. I want to create a bar plot essentially with the relative (or absolute) frequency of each number. Therefore something like this:
If if use the histogram() function, then it only plots a line connecting the dots
And if I use bar() function, then it plots each row individually.
Can you please help? thank you!
Voss le 13 Mar 2023
histogram seems to work fine:
data = randi([0,7],46,1);
Maybe you have another function called histogram that's being run instead. Do
which histogram -all
to see which histogram functions you have, and if there are any besides the built-in, rename them to something else.