title: Add a marker in a stacked bar diagramm
body: <p>with some help I was able to realize a stacked bar dagramm the way I need t to be. Only one part is missing: A marker which represents the median. Sadly, I couldnt come up with any ideas of how to add one and couldnt find any help in the internet. This picture shows my diagramm and how I want to add a marker the way it is shown. It doesnt have to be that way, a swaure or sth else would do the job too.</p>
  
  <p><a href="https://i.stack.imgur.com/A6WqT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A6WqT.jpg" alt="without marker"></a></p>
  
  <p><a href="https://i.stack.imgur.com/SlqZq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SlqZq.jpg" alt="with marker"></a></p>
  
  <p>code to generate the plot: (breite is a excel sheet that i imported. you can use testw and delete the testw = breite to test the code)</p>
  
  <pre><code>% testw = [0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ...
  %     0.3568 0.452 0.494 0.2982 0.3892 0.675 0.576 0.489 0.745 0.225 ];
  testw = breite;
  
  %Datenvorbereitung
  gerundet = round(testw,1);
  
  maximum = max(gerundet),1;
  anzahl = ceil(maximum / 0.1);
  
  werte = zeros([1 anzahl]);
  sz = size(werte);
  haeufigkeit = zeros(sz);
  
  for i= 1:anzahl
      werte(i) = 0.1*i;
  end
  
  wertebereich = zeros(sz);
  
  for i = 1:anzahl
      wertebereich(i) = 0.1;
  end
  
  %Häufigkeitsverteilung
  for i = 1:10000
      if gerundet(i) &lt;= 0.2
          haeufigkeit(1) = haeufigkeit(1) + 1
      else
          for j = 2:anzahl
              if gerundet(i) &gt;= werte(j-1) &amp;&amp; gerundet(i) &lt; werte(j)
                  haeufigkeit(j) = haeufigkeit(j) + 1
              end
          end
      end
  end
  
  %Grauwerte
  prozentual = zeros(sz);
  
  for i = 1:anzahl
      prozentual(i) = haeufigkeit(i)/sum(haeufigkeit)
  end
  
  grauwerte = zeros(sz);
  
  for i = 1:anzahl
      grauwerte(i) = round(1-1*prozentual(i),3);
  end
  
  colormap gray
  b = bar([wertebereich; nan(size(wertebereich))],'stacked');
  % colorbar('Direction','reverse')
  colorbar('Ticks',[0, 0.2, 0.4, 0.6 ,0.8, 1],...
           'TickLabels',{'100%','80%','60%','40%','20%', '0%'})
  
  for i = 1:anzahl
       b(1,i).FaceColor = [grauwerte(i) grauwerte(i) grauwerte(i)];
       b(1,i).EdgeColor = 'none';
  end
  </code></pre>