title: Minor grid with solid lines & grey-color
body: <p>I'm using the following to display the minor grid in my plot:</p>
  
  <pre><code>grid(gca,'minor') 
  set(gca,'MinorGridLineStyle','-')
  </code></pre>
  
  <p>but I'd like to change the color of the grid lines to a nice greyscale. I can't find any option 'grid color' in matlab... Do you know any or any workaround?
  I found this: <a href="http://www.mathworks.com/matlabcentral/fileexchange/9815-gridcolor" rel="nofollow noreferrer">http://www.mathworks.com/matlabcentral/fileexchange/9815-gridcolor</a> but as I read of the comments, it doesn't work very well and further it only changes gridcolor, not the color of the minor grid...
  Thanks!</p>
  
  <hr>
  
  <p><strong>EDIT</strong>:
  Problem with <code>semilogx</code> as posting here now:</p>
  
  <pre><code>x = [1e-9 1e-8 1e-7 1e-6 1e-5 1e-4 1e-3 1e-2]';
  y1 = linspace(20, 90, 8);
  y2 = y1.^2;
  y3 = y1./y2+5;
  
  % plotte: http://www.mathworks.com/help/techdoc/ref/linespec.html
  myfig = figure('Position', [500 500 445 356]); %[left, bottom, width, height]:
  p1 = semilogx(x,y1,'x--r',x,y2,'*-b');
  
  ax1 = gca;
  set(ax1, 'Position',[0.13 0.18 0.75 0.75]);
  
  xlim([0 max(x)]);
  ylim([0 max([max(y1) max(y2)])]);
  
  
  col=.85*[1 1 1];
  %# create a second transparent axis, same position/extents, same ticks and labels
  ax2 = axes('Position',get(ax1,'Position'), ...
      'Color','none', 'Box','on', ...
      'XTickLabel',get(ax1,'XTickLabel'), 'YTickLabel',get(ax1,'YTickLabel'), ...
      'XTick',get(ax1,'XTick'), 'YTick',get(ax1,'YTick'), ...
      'XLim',get(ax1,'XLim'), 'YLim',get(ax1,'YLim'),...
      'XScale', 'log');
  
  %# show grid-lines of first axis, give them desired color, but hide text labels
  set(ax1, 'XColor',col, 'YColor',col, ...
      'XMinorGrid','on', 'YMinorGrid','on', ...
      'MinorGridLineStyle','-', ...
      'XTickLabel',[], 'YTickLabel',[],'XScale', 'log');
  
  
  %# link the two axes to share the same limits on pan/zoom
  linkaxes([ax1 ax2],'xy');
  </code></pre>
  
  <p>Displaying like this:
  <img src="https://i.stack.imgur.com/0zsRh.jpg" alt="enter image description here"></p>
  
  <hr>
  
  <p><strong>EDIT2:</strong> A problem occurs when adding a second y-axes as in the following picture, look at the ticks of the right y-axes:</p>
  
  <p><img src="https://i.stack.imgur.com/RUPHD.jpg" alt="enter image description here"></p>
  
  <p>this will be discussed here to have a better overview!
  <a href="https://stackoverflow.com/questions/6584105/matlab-problem-with-ticks-when-setting-minor-grid-style-and-two-y-axis">Matlab: Problem with ticks when setting minor grid style and two y-axis</a></p>