minor ticks are getting erased

1 view (last 30 days)
Tim Gordon
Tim Gordon on 14 Jun 2012
I've written code to create a figure with four subplots. I was originally specifying the subplots as follows (for the upper right plot):
But I found that Matlab was resizing the four plots so that the length and widths were not all the same. I want them to be the same. So I replaced the line above with
axh1=subplot('position',[.175 .6 .25 .25]);
Since I'm specifying position and size with that, I thought I would just be able to do that for all four subplots. What I find is that the minor tick marks on the y-axis disappear. Strangely, if I drag the corner of the figure window and enlarge it, the tick marks reappear, suggesting that it's just a cosmetic issue. But if I click Copy Figure and then paste into a document, the minor tick marks are gone! What's going on? Do I need to write the figure to a file somehow?
Here's the rest of the code (for the first subplot) if you want to try to run it. You'll have to make up some data for the variable PM
axh1=subplot('position',[.175 .6 .25 .25]);
set(axh1,'YLim',[1 1000]);
set(get(gca,'YLabel'),'String','primary PM (mg/kg-fuel)');
set(gca, 'YMinorTick', 'on');
  1 Comment
Walter Roberson
Walter Roberson on 14 Jun 2012
I suspect that get(gcf, 'Renderer') is going to show you OpenGL. Try using one of the other renderers.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!