Plotting curves over histogram: problem with legend
Show older comments
Hello lovely people,
I am adding two curves to my histogram. It all looks well and good, but there's a problem with the legend.
As you can see in the attachent, the legend does appear, with the desired lables. The histogram indicator is there, but the line plot indicators are missing.
I'm sure I'm doing something wrong, but cannot figure out what. Please could someone help?
Many thanks in advance!
Lukas
EDIT: I exported the figure as .svg and they magically appeared! Maybe it's just a bug then?
hold on
hist = histogram(V, [0.5:28.5],'normalization','probability','FaceColor',[0.3010 0.7450 0.9330],'DisplayName','measured data')
plot1 = plot(Weib_Bow(:,1),Weib_Bow(:,2),'DisplayName','Bowden')
plot2 = plot(Weib_Mat(:,1),Weib_Mat(:,2),'DisplayName','MATLAB')
legend
title('wind speed frequency distribution')
xlabel('V (m/s)')
ylabel('probability')
hold off
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!