how to make bar graph outline dotted?
    15 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Minka Califf
 il 17 Mag 2018
  
    
    
    
    
    Commentato: Minka Califf
 il 17 Mag 2018
            I can't seem to get the solid black line around the bars to become dotted like so:

 %load data
data = [239 199 192 146 123 111 103];
labels = {'A380', 'A350', 'A330-200', 'A318', 'A319neo', 'A320neo', 'A321neo'};
figure;
barh(data, 'FaceColor', [0.75 0.75 0.75]);
%title
title('Airplane length in feet', 'fontsize', 16, 'fontweight', 'normal');
%move x axis to top
set(gca, 'XAxisLocation', 'top');
 % set the position of the axis to allow room for the long name labels on the left.
 set(gca, 'units', 'normalized', 'position', [.2 .15 .7 .7], ...
 'ytick', [], 'xtick', 0:50:250, 'xgrid', 'on', 'gridlinestyle', '-', ...
 'ticklength', [0 0], 'box', 'on', 'fontsize', 14);
0 Commenti
Risposta accettata
  Aditya Salveru
      
 il 17 Mag 2018
        
      Modificato: Aditya Salveru
      
 il 17 Mag 2018
  
      Hi,
You can get dotted lines instead of solid black lines by setting LineStyle property of barh to ':' . You can also change the width of the dotted line by using  LineWidth property.
Change the parameters of the barh as given below.
barh(data, 'FaceColor', [0.75 0.75 0.75],'LineStyle',':','LineWidth',1.5);
Thanks,
Aditya
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Annotations in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

