# Wrong graphic due the scale , tikz

Hi i want to graphic the function: -2.5x^2+30x-50

if you search the equation in google:

but when i put it on latex:

The green curve is that equation and it is wrong

i use an escale: 1x10^{-3} is equal to 2 , just using the labels.

the code

\begin{tikzpicture}
\begin{axis}[ %inner axis line style={-latex},
width=15cm,height=6cm,
axis x line=center,
axis y line=center,
xlabel={$t[s]$},ylabel={$v(t)[V]$},
unit vector ratio*=2 1 1,
xmin=-2,
xmax=14,
ymin=-5,
ymax=5,
xtick={2,4,6,8,10,12}, xticklabels={$1x10^{-3}$,$2x10^{-3}$,$3x10^{-3}$,$4x10^{-3}$,$5x10^{-3}$,$6x10^{-3}$},
ytick={-2,2,4}, yticklabels={-20,20,40},
]

\draw[red!60,domain=0:2,samples=100,ultra thick]plot(\x,0.25*\x^2);
\draw[red!60,domain=0:2,ultra thick] plot[smooth] coordinates {(2,1)(4,3)};

\draw[green!60,samples=100,ultra thick]plot(\x^2,-2.5*\x^2+30*\x-50);
\end{axis}
\end{tikzpicture}


Thanks .

• Please make your question's title more accurate to the issue at hand. (make it searchable) – Jonathan Komar Apr 10 '17 at 6:39

You scaling seems wrong but I have no idea what units you were trying to use, which is why I simply rescaled them to your intended 2 -> 1e-3.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[
/pgf/number format/sci generic={
mantissa sep=\times,
exponent={10^{#1}},
}
]
\begin{axis}[
axis lines=center,
tick scale binop=\times,
scaled ticks=false,
xlabel={$t[s]$},
ylabel={$v(t)[V]$},
xticklabel style={rotate=20},
domain=0:6e-3,
]
\addplot[red!60  ,samples=100,ultra thick] {0.25*(x*2e3)^2};