How to assign a reference point in graph?

5 vues (au cours des 30 derniers jours)
LAKSHMANAN ADAIKKAPPAN
LAKSHMANAN ADAIKKAPPAN le 6 Avr 2016
how to assign reference point(0,0) at left top corner like following figure?

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Avr 2016
plot(rand(1,30))
set(gca,'YDir', 'reverse')
  3 commentaires
Muhammad Usman Saleem
Muhammad Usman Saleem le 6 Avr 2016
have you check output of this code? @LAKSHMANAN ADAIKKAPPAN
Walter Roberson
Walter Roberson le 7 Avr 2016
Modifié(e) : Walter Roberson le 7 Avr 2016
Certainly I have checked the output of the code. If you prefer to see the full 0 to 14 and 0 to 16, change the graph to use that, such as
plot(0:16, 14 * rand(1,17))
and you might want to set the axis location as well,
set(gca, 'ydir', 'reverse', 'xaxislocation', 'top')
This could be taken further to get rid of the tick marks but leave the tick labels. The ease of doing that would depend upon the MATLAB version being used.

Connectez-vous pour commenter.

Plus de réponses (2)

Muhammad Usman Saleem
Muhammad Usman Saleem le 6 Avr 2016
Modifié(e) : Muhammad Usman Saleem le 6 Avr 2016
UPDATE 1:
may try this
plot(1:10)
box off
axes('xlim', [1 10], 'ylim', [1 10], 'color', 'none', 'YAxisLocation', 'right', 'XAxisLocation', 'top')
for reading read here
or may try this
t=0:0.1:10;
y=sin(t);
plot(t,y)
set(gca,'XAxisLocation','top','YAxisLocation','left','ydir','reverse');
  3 commentaires
Walter Roberson
Walter Roberson le 6 Avr 2016
No, the key is YDir reverse
LAKSHMANAN ADAIKKAPPAN
LAKSHMANAN ADAIKKAPPAN le 6 Avr 2016
Modifié(e) : LAKSHMANAN ADAIKKAPPAN le 6 Avr 2016
Thank you for your guidance sir. It will work.

Connectez-vous pour commenter.


Steven Lord
Steven Lord le 6 Avr 2016
plot(1:10, 1:10);
axis ij
Or if you have the handle of your axes object already, change its YDir property to 'reverse' as Walter showed.
  1 commentaire
LAKSHMANAN ADAIKKAPPAN
LAKSHMANAN ADAIKKAPPAN le 6 Avr 2016
Thank you for your guidance sir. It will also work.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Lighting, Transparency, and Shading 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