How to stop Histogram from covering Tick Marks

조회 수: 3 (최근 30일)
Jon
Jon 2013년 9월 26일
편집: Irfan Mulla 2018년 5월 16일
How do you stop a histogram from covering tick marks on a graph? It's rather bewildering that they get covered up.
Edit: I have found one solution is to plot the tick marks pointing outward.
figure1 = figure('units','normalized','outerposition',[0 0 1 1]);
axes1 = axes('Parent',figure1,'YMinorTick','on','YGrid','on',...
'XMinorTick','on','XGrid','on','TickDir','out');
The important part there is 'TickDir','out' I would still like to know how to plot marks over a histogram for future reference.
  댓글 수: 2
Image Analyst
Image Analyst 2013년 9월 26일
What is your code for plotting the histogram? Did you use bar() or plot()? Show the exact line of code.
Jon
Jon 2013년 9월 26일
편집: Jon 2013년 9월 26일
The only two ways to make a 1d histogram, that I know of, are bar and hist. They both cover up tick marks.
figure1 = figure('units','normalized','outerposition',[0 0 1 1]); axes1 = axes('Parent',figure1,'YMinorTick','on','YGrid','on',... 'XMinorTick','on','XGrid','on');
bar or hist

댓글을 달려면 로그인하십시오.

답변 (2개)

Jing
Jing 2013년 9월 26일
I think you already got the point to show the tick marks for BAR or HIST. In the doc of Axes Properties, it states under TickDir, for 2-D views, the default is to direct tick marks inward from the axis lines. So you have to manually set the TickDir to 'out'.
And in your last sentence, what do you mean by 'plot marks over histogram'?
  댓글 수: 2
Jon
Jon 2013년 9월 26일
편집: Jon 2013년 9월 26일
If you do not set the tick marks to point outward you cannot see them on a histogram... The histogram covers the tick marks. I would like to not point them outward and still have them visible. As in have them plotted on top not underneath the histogram.
Jon
Jon 2013년 9월 26일
I think for clarity and consistency I will just change every graph I do to have the tick marks on the outside.

댓글을 달려면 로그인하십시오.


Irfan Mulla
Irfan Mulla 2018년 5월 16일
편집: Irfan Mulla 2018년 5월 16일
set(gca, 'Layer','top'); set(gca,'TickDir','Out')

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by