minor ticks are getting erased

1 回表示 (過去 30 日間)
Tim Gordon
Tim Gordon 2012 年 6 月 14 日
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 件のコメント
Walter Roberson
Walter Roberson 2012 年 6 月 14 日
I suspect that get(gcf, 'Renderer') is going to show you OpenGL. Try using one of the other renderers.


回答 (0 件)


Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by