Plotting curves over histogram: problem with legend
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
