필터 지우기
필터 지우기

I want the plot the bar graph touching the y axis

조회 수: 9 (최근 30일)
Vikash Raj
Vikash Raj 2022년 7월 16일
편집: Vikash Raj 2022년 7월 16일
Hi,
I have plotted the bar graph but I can see the gap between the Y axis and the first bar. How to remove this empty space. Im attaching my codes and the bar graph. Any help and suggestions will be highly appreciated . Thank you.
bar(Kp, 1, 'FaceColor',[0.5088 0.1833 0.5511], 'EdgeColor', [0 0.8 0.7] ); % purpul color
ylim([0 9]);
xticks([]);
ylabel('Kp Index (nT)','fontweight','bold','FontSize',10);
xline([9.5 17.5 25.5 33.5 41.5], '--m','LineWidth',2);
axis tight
box on
ax = gca;
ax.LineWidth = 2;

채택된 답변

KSSV
KSSV 2022년 7월 16일
Read about xlim, axis
  댓글 수: 1
Vikash Raj
Vikash Raj 2022년 7월 16일
편집: Vikash Raj 2022년 7월 16일
Thank you for your suggestion. I managed to fix this problem using xlim.
ax = gca;
ax.XLim = [1.5, 49.5];

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by