can you help me, to modify the parameters of the axes in matlab R2014a
조회 수: 1 (최근 30일)
이전 댓글 표시
can you help me, to modify the parameters of the axes in matlab R2014a all these works are not taken into account in this version.
ax = gca
ax.XAxisLocation = 'top'
ax.YAxisLocation = 'left'
ax.XDir = 'normal'
ax.ZDir = 'reverse'
ax.DataAspectRatio = [1 1]
ax.PlotBoxAspectRatio = [1 1]
ax.PlotBoxAspectRatioMode='manual'
ax.Position=[0 0 1 1]
ax.ActivePositionProperty='position'_
I want to change:
- the Xaxes in top
- reverse the direction of the Y axis
- change position in [0 0 1 1]
- and modify ax.DataAspectRatio = [1 1]
댓글 수: 0
답변 (3개)
Ameer Hamza
2018년 5월 1일
In R2014a, you can use set() to modify the properties. For example to modify XAxisLocation use
set(ax, 'XAxisLocation', 'top');
you can modify all other properties with similar method.
댓글 수: 3
Ameer Hamza
2018년 5월 3일
Have you run following line
ax = gca;
also, type
class(ax)
does it output: matlab.graphics.axis.Axes?
Jan
2018년 5월 3일
@manel: Then "ax" has been defined as a struct before. Search for anything like "ax.XDir...", where "ax" is overwritten by a struct.
Jan
2018년 5월 3일
ax = gca
set(ax, 'XAxisLocation', 'top', ...
'YAxisLocation', 'left', ...
'XDir', 'normal', ...
'ZDir', 'reverse', ...
'DataAspectRatio', [1 1], ...
'PlotBoxAspectRatio', [1 1], ...
'PlotBoxAspectRatioMode, 'manual', ...
'Position', [0 0 1 1], ...
'ActivePositionProperty, 'position');
This should work.
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!