Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

How do I get rid of the flat coloring in a bar graph?

2 views (last 30 days)
rkepp12
rkepp12 on 19 Aug 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
I am trying to create bar graphs with two different sets of data plotted on the same axes. Below is the code I am using to produce the bar graphs:
figure(10+1000*i+100*j)
bar(syncedCrankPhase_rev_avg, datVec_emg_hist(:,3), 'FaceColor', 'r')
hold on
bar(syncedCrankPhase_rev_avg, datVec_emg_hist(:,4), 'FaceColor', 'b')
hold off
xlabel('Crank Position (degrees from +x axis)')
ylabel('Probability of Onset')
title('Average Onset Detection of Biceps and Triceps Over Crank Revolution')
legend('Biceps', 'Triceps')
I have also attached the plot that it creates. The problem is that there should be two separate data sets (in two separate colors), but instead I get a single bar graph with the data sets merged together and flat color shading. Does anyone know how I can fix this? Is it a problem with my settings?

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!