How to Add a Marker (say an asterisk) to a Hist3 Plot

6 visualizaciones (últimos 30 días)
Shawn
Shawn el 13 de Mzo. de 2015
Comentada: Shawn el 16 de Mzo. de 2015
I am trying to add asterisks to my histograms to mark various important points. Currently, I use the following code for my histograms:
wn1 = 21*rand(100000,1);
zeta1 = 100*rand(100000,1);
wn1zeta1_matrix = [wn1 zeta1];
hist3(wn1zeta1_matrix,'Edges',{0:5.25:21 0:5:100})
colorbar
set(gcf,'renderer','zbuffer');
set(get(gca,'child'),'FaceColor','interp','CDataMode','auto');
axis([0 21 0 100])
% set(gca,'YTick',[-14 -10 -5 0 5 10 15])
xlabel('{\omega}_n (rad/s)')
ylabel('{\zeta} (%) ','rot',0)
title('Histogram of Damping Ratio versus Natural Frequency')
set(gca,'FontSize',10,'fontWeight','bold')
set(findall(gcf,'type','text'),'FontSize',10,'fontWeight','bold')
I tried using the insertMarker command to no avail.
insertMarker(gcf,[147 279],'*')
How might I add, for example, an asterisk at the point (1,1)?
  1 comentario
Shawn
Shawn el 16 de Mzo. de 2015
I was able to figure it out. I added a part for a line(plot3) and for a marker (scatter3).
wn1 = 21*rand(100000,1);
zeta1 = 100*rand(100000,1);
wn1zeta1_matrix = [wn1 zeta1];
hold on
hist3(wn1zeta1_matrix,'Edges',{0:5.25:21 0:5:100})
N=hist3(wn1zeta1_matrix,'Edges',{0:5.25:21 0:5:100});
maxN = max(N(:));
colorbar
set(gcf,'renderer','zbuffer');
set(get(gca,'child'),'FaceColor','interp','CDataMode','auto');
scatter3([1.5 1.5], [1.5 1.5],[maxN maxN],25,'w*'); %adds a marker
plot3([0 0.4246*100], [0.4246*100 0],[maxN maxN],'w','LineWidth',1); %adds a line
hold off
axis([0 21 0 100])
% set(gca,'YTick',[-14 -10 -5 0 5 10 15])
xlabel('{\omega}_n (rad/s)')
ylabel('{\zeta} (%) ','rot',0)
title('Histogram of Damping Ratio versus Natural Frequency')
set(gca,'FontSize',10,'fontWeight','bold')
set(findall(gcf,'type','text'),'FontSize',10,'fontWeight','bold')

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by