title: Removing Particular Objects From a Legend
body: <p>I need your guys help in solving a small problem Im facing. When I want to depict f1 and f2 using bar function, I need to exclude f2 annotation objects in the legend tab of the figure, but the set syntax written below seems to give the error mentioned.</p>
  
  <p>The code is as below:</p>
  
  <pre><code>f1= bar([SN, SN, SN], [Class_Work, Final_Exam, Shift_Grade'-Grade], K, 'stacked');
  
  f2= bar([SN(idx), SN(idx), SN(idx)], [Class_Work(idx), Final_Exam(idx), SG(idx)-Grade(idx)], K*dy/dx, 'stacked', 'LineWidth', 2.5);  
  
  set(f1,{'DisplayName'},{'Mid-Term','Final-Exam','Shift'}')
  legend('location','NorthEast','Orientation','horizontal'); 
  
  % in order to Exclude f2 indices from legend: (BUT SEEMS NOT WORKING based on error!)
  set(get(get(f2,'Annotation'),'LegendInformation'),...
      'IconDisplayStyle','off');
  </code></pre>
  
  <p>After running it gives this error in command-window including the correct figure, but with all annotation objects:</p>
  
  <p>??? Error using ==> get</p>
  
  <p><em>Conversion to double from cell is not possible.</em></p>
  
  <p>Error in ==> set(get(get(f2,'Annotation'),'LegendInformation'),...</p>
  
  <p><strong>The Figure, which I need is that: <em>data4, data5, and data6</em> graphic objects (related to f2) in the legend tab NOT to appear, when drawing f2.</strong></p>
  
  <p>I appreciate your helps in advance.</p>