how plot two figures on same axis with two different origin points

3 vues (au cours des 30 derniers jours)
HARIKRISHNA B YADULADODDI
Commenté : Star Strider le 2 Mai 2021
I have to draw two plots (first plot is square of 50x50, inside this square an vector field(second plot) by using quiver command) , for first plot the origin has to be at bottom left corner and for second plot the origin has to be at top left corner ( x axis ranges from 0 to 50 and y axis ranges form 0 to 50 for both the plots) for first plot the y values ( 0 to 50) shoud go from bottom to top and for second plot y values ( 0 to 50) should go from top to bottom, the xaxis is same for both the plot . i have added an y axis on right side but i want to make it invisible or off ...is there possible way to make y axist on right side to make invisible or off
Any other suggestion other than adding extra y axis (yyaxis right).
KIndly help me .
  2 commentaires
Jan
Jan le 1 Mai 2021
I'm confused: You have a "single figure", but then you speak of "first" and "second" figure. What exactly is a "graph"? What is your question? I assume all you need is to set the 'YDir' proerpty to 'reverse' in one of the axes (not figures).
HARIKRISHNA B YADULADODDI
i have to draw a square of 50x50 by considering origin at bottom left corner and inside this square i have to plot an vector field (by using quiver command) whose origin should be at top left corner and x axis will remain same for square and vector field. and i want to show the axis only on left side (if we are defining any new axis then they those axis should be off)

Connectez-vous pour commenter.

Réponses (1)

Star Strider
Star Strider le 1 Mai 2021
If the x-axis is the same for both curves, while one curve has the origin (I assume this means the 0 value on the y-axis) at different values, I would use the yyaxis function, creating separate y-axes for each curve.
  4 commentaires
HARIKRISHNA B YADULADODDI
Ax.yaxis(2),visible='off' is not working in my matlab (R2020a). its showing following error
'Unrecognized method, property, or field 'Yaxis' for class 'matlab.graphics.axis.Axes'.'Warning: Only 'auto' DataAspectRatio is supported for axes with multiple coordinate systems'.
Star Strider
Star Strider le 2 Mai 2021
I am using R2021a, so I get the posted result. This should also work in R2020a.
It is important to note that MATLAB is case-sensitive, and that applies to the structure notation in addressing graphics properties (although not to set and get calls, making this a bit confusing at times).
Use this exactly as I typed it —
Ax.YAxis(2).Visible = 'off'; % Make Right Y-Axis Invisible
and you should get the result I posted.

Connectez-vous pour commenter.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by