can you help me, to modify the parameters of the axes in matlab R2014a

2 vues (au cours des 30 derniers jours)
manel maatouk
manel maatouk le 1 Mai 2018
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]

Réponses (3)

Ameer Hamza
Ameer Hamza le 1 Mai 2018
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 commentaires
Ameer Hamza
Ameer Hamza le 3 Mai 2018
Have you run following line
ax = gca;
also, type
class(ax)
does it output: matlab.graphics.axis.Axes?
Jan
Jan le 3 Mai 2018
@manel: Then "ax" has been defined as a struct before. Search for anything like "ax.XDir...", where "ax" is overwritten by a struct.

Connectez-vous pour commenter.


Jan
Jan le 3 Mai 2018
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.
  1 commentaire
manel maatouk
manel maatouk le 3 Mai 2018
this answer is accepted I mean without error but actually nothing changes for the display ie nothing is applied to the typed configuration

Connectez-vous pour commenter.


manel maatouk
manel maatouk le 3 Mai 2018
What I want to do is draw with a plot a straight inclined with 20 degree (angle theta)and get the matrix that represents, it using:
F = getframe;
[X, map] = frame2im (F);
but for that I need to modify the axes of the plot to have the same unit for Xaxe and Yaxe and even to use as a unit the pixel

Catégories

En savoir plus sur Graphics Object Identification dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by