
How can I plot this curve ?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Mallouli Marwa
 el 6 de Ag. de 2022
  
    
    
    
    
    Editada: Image Analyst
      
      
 el 6 de Ag. de 2022
            Hi
How can I plot this curve ?
3 comentarios
Respuesta aceptada
  Image Analyst
      
      
 el 6 de Ag. de 2022
        
      Editada: Image Analyst
      
      
 el 6 de Ag. de 2022
  
      Use bar, xlabel, ylabel, title, and xticklabels.  Use text to add text to other places, like atop the bars.
fontSize = 18;
% Define data.
data = [109, 70, 76, 85, 26];
% Define colors
purple = [153, 153, 255] / 255;
grayBackground = [192, 192, 192] / 255;
bar(data, 'BarWidth', 0.4, 'FaceColor',purple);
ax = gca;
ax.Color = grayBackground;
grid on;
xlabel('annees', 'FontSize',fontSize);
ylabel('Hueres (Eq. TD)', 'FontSize',fontSize)
title('Services 2001 - 2006 (366 H Eq. TD)', 'FontSize',fontSize)
xticklabels({ ...\
    '2001-2002',... 
    '2002-2003',...
    '2003-2004',...
    '2004-2005',...
    '2005-2006'
    })
% Put labels atop the bars.
for k = 1 : numel(data)
    str = sprintf('%d', data(k));
    xt = k;
    yt = data(k);
    text(xt, yt, str, 'Color','k', 		...
        'VerticalAlignment','bottom', 'HorizontalAlignment','center', ...
        'FontSize', fontSize, 'FontWeight', 'bold');
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Annotations en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



