Two graphs in one picture
Two graphs in one picture
(OP)
Is it possible to draw two graphs in one picture?
For example: I have inequation:
abs(x^2 + 3x + 2) < abs(x^3 + 1)
I know how to draw one graph at once:
y = abs(x^2 + 3*x + 2)
ezplot(y)
y1 = abs(x^3 + 1)
ezplot(y1)
But I would like to draw both graph on the same picture, so I can compare the results. Is this possible?
For example: I have inequation:
abs(x^2 + 3x + 2) < abs(x^3 + 1)
I know how to draw one graph at once:
y = abs(x^2 + 3*x + 2)
ezplot(y)
y1 = abs(x^3 + 1)
ezplot(y1)
But I would like to draw both graph on the same picture, so I can compare the results. Is this possible?





RE: Two graphs in one picture
Try this... It works in Matlab 7.0 and i am hopeing that the 'hold'command exists in yor version as well.
y = abs(x^2 + 3*x + 2)
y1 = abs(x^3 + 1)
ezplot(y)
hold
ezplot(y1)
RE: Two graphs in one picture
thanks a lot for your answer. Do you know also how to change the colour of the graph so I can have one graph for example red and the other blue?
Greetings,
Frenky
RE: Two graphs in one picture
In future posts tell people what the version number and the name of the software is. And perhaps if you are having a module issue tell which module you are using so people know how to approach your question.
This is a chunk of the help files that should be included in you matlab software. I am not sure but i bet maple had similar files.
h
the website above should of shown you linespec which are all the modifiers that you can use in plot() or line() or similar commands.
If you have further questions about functions and thier uses. I would go to www.mathworks.com and use thier reference pages to see if it can answer your question first before coming on to this forum.
I hope this helps....
BSK
RE: Two graphs in one picture
RE: Two graphs in one picture
Give the handles, anything is possible. Changing the colour is a doddle. For example:
h=ezplot('cos(x)');
set(h,'color','red');
RE: Two graphs in one picture