How to lie with statistics. ;-) (Yes, that is the name of a little book I read long ago.)
My point is, not that you or anyone is intentionally trying to lie here, but that by changing the axis scaling, it is easy to make one curve look completely unalike another, or to convince someone that something looks very different from what they might otherwise conclude.
Yes, you definitely need to use element-wise multiplication. But then you need to use plot correctly!
x = linspace(-pi,pi,100);
y = x.*x.*x+x.*x+2.*x;
plot(x,y)
This looks as I would expect. However, now lets change the auto-scaling that MATLAB uses, into the apparent scaling used in your first plot.
Identically the same plot, but it certainly looks different. You were rushing to draw conclusions about something, based on nothing more significant than an axis scaling.
The point being to always beware of the axes on a plot, don't jump to conclusions.
As I said, this is a textbook case of how creative plotting can result in an interesting set of conclusions. Now, just imagine someone actually wanted to convince someone of anything they want? Again, it is amazingly easy to do. Just manipulate the plots to look as you want them to look. ;-) Sad, but true. And there are too many people in this world willing to do exactly that.
Best Answer