I am plotting a non-linear function -2/3 x^ 3 + x^2-3x+4/3 in the interval [0,1/2], I tried to change the scales to make it look less linear but still looks like a straight line. Any suggestions?

\draw[<->] (0,1.5)--(0,-.3);
\draw[<->] (-.3,0)--(1,0);
\draw[] (1,0) node[right]{\small $x$};
\draw[color=blue]   plot[samples=200] (\x,{ifthenelse(\x <.5,-(2/3)*\x^3+\x^2-3*\x+4/3,(2/3)*\x^3-\x^2+3*\x-4/3))}) node[right] {\small{$b(x)$}};
\draw[color=red] (-.2,0.635) node[right]{$\beta$};
\draw[color=red] (0,0.635)--(1,0.635);
  • Welcome to tex.stackexchange.com. I edited your question by indenting your code by 4 spaces, so that it gets formatted correctly. – yori Apr 17 '14 at 15:40
  • @Yori: thanks! I went to other posts to see why my code was muddled but by the time I started editing it, you had already fixed it. – Sergio Parreiras Apr 17 '14 at 15:41
  • 1
    Also, we usually ask for a minimum working example (MWE) which highlights the core of the problem. Your example (a) does not compile and (b) seems to have a lot of code that is irrelevant for the question. You have a better chance of getting a good answer by removing the irrelevant code. – yori Apr 17 '14 at 15:43

PSTricks can help to analyze the graph.

Because in the given interval 0 <= x <= 1/2 the function f(x)=(-2*x^3+3*x^2-9*x+4)/3 is almost identical to the line g(x)=(-8*x+4)/3 passing (0,f(0)) and (1/2,f(1/2)) as shown in the following figure.



enter image description here

  • The red is the graph of f(x)=(-2*x^3+3*x^2-9*x+4)/3.
  • The blue is the graph of g(x)=(-8*x+4)/3.
  • The green is the graph of |f(x)-g(x)|.

That is why scaling will not help.


I would say you can't because your interval is too small.

See how the plot looks in wolfram alpha using small axis limits.


Image generated from wolframalpha

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.