how plot two figures on same axis with two different origin points
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
Jan
2021-5-1
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).
回答(1 个)
Star Strider
2021-5-1
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 个评论
Star Strider
2021-5-2
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!