필터 지우기
필터 지우기

What to do if the second axis is not positioned well?

조회 수: 3 (최근 30일)
Very Determined
Very Determined 2015년 7월 1일
편집: Very Determined 2015년 7월 2일
Hi,
I am trying to add second x and y axis on a plot to show different units and values. Below is the code but it sounds like it doesn't work properly as the second axes are not located properly (can be seen on attached jpg file ). I figured it out that the problem source is the first axis x and y labels as it works when I remove them. How can I fix the problem? Thanks
xlabel('()');
ylabel('Flow');
haxes1 = gca; % handle to axes
set(haxes1,'XColor','k','YColor','k')
haxes1_pos = get(haxes1,'Position'); % store position of first axes
haxes2 = axes('Position',haxes1_pos,...
'YLim',[y_min y_max],...
'XLim',[x_min x_max],...
'XAxisLocation','top',...
'YAxisLocation','right',...
'Color','none');
set(gca, 'YScale', 'log');
set(gca, 'XScale', 'log');
xlabel('d(mm)','VerticalAlignment','bottom');
ylabel('FLO','VerticalAlignment','cap');
print -djpeg -r300 chart.jpg
print -dpsc chart.eps
  댓글 수: 4
dpb
dpb 2015년 7월 1일
I don't see that...I ran your code and with the exception of the labels not matching ticks looked fine.
Very Determined
Very Determined 2015년 7월 2일
편집: Very Determined 2015년 7월 2일
Have you looked at the jpg file? To me, the figure itself looks good but not the jpg version.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by