scatter points on top of bar not showing

4 views (last 30 days)
I am trying to plot a scatter of points on top of a stacked bar chart. I can see half of some of the points where the circle of the scatter goes below zero slightly, but the rest appear to be hidden under the bars. I am using 'hold on' so I don't know what is going wrong! I can plot either the graph or scatter on its own and I get what I want. The scatter points use the same x-axis values as the bar. I just don't understand what I'm doing wrong! You can just about see the half scatter points on the last three bars.
figure();
bar(All_A_fluxes(:,1:7),'stacked'); hold on; %Not including dQ
scatter([1:19],All_A_fluxes(:,8));

Accepted Answer

Catriona
Catriona on 17 Dec 2020
Its ok problem solved!! The scatter points were the same colour as the bars, ha! That's why I couldn't see them. I think I need a holiday...
figure();
bar(All_A_fluxes(:,1:7),'stacked'); hold on; %Not including dQ
scatter([1:19],All_A_fluxes(:,8),12,'w'); %<----- now plotted as white

More Answers (0)

Tags

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!