How do I use the plot function if I have to plot along the (y = constant) or (x=constant)?
2 views (last 30 days)
Show older comments
I am stuck in a very basic problem but I need help.I want to keep 'x coordinate' constant and plot for y(the values for y theoretically should vary from positive infinity to negative infinity). What would be the procedure if we want to do the same for 'y' i.e 'y coordinate'as constant and varying x from positive infinity to negative infinity.
0 Comments
Answers (1)
Walter Roberson
on 13 Sep 2017
yL = ylimit();
plot([constant_x, constant_x], YL);
and
xL = xlimit();
plot(xL, [constant_y, constant_y]);
This code draws between the current plot limits, since you cannot draw infinitely. The distinction of plot limits matters if you are planning to allow the user to pan (scroll) areas that are not currently visible: the code above does not by itself create an effectively infinite line segment that should be drawn no matter how far the user pans.
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!