Using all three of these:
width=6in
axis equal image
unit vector ratio={1 100}
makes no sense. Most of what axis equal image
does is to set unit vector ratio={1 1}
which you immediately override with the other setting. The only other thing it does is to shrink the axis box to fit the axis min and max values at the specified unit vector ratio
, which renders the width
key setting totally impossible to reach because of the selected unit vector ratio.
Just let pgfplots
do its job (use the width
and height
keys) and everything works fine. Here's a truly minimal example of that at work1:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
samples=100,
width=6in,
height=4in, % or whatever height you want
% axis equal image,
% unit vector ratio={1 250},
]
\addplot[domain=-2:20] {400*x - x^3};
\end{axis}
\end{tikzpicture}
\end{document}

1: I've said this before, and I'll say it again: putting all of the excess styling code in all of your questions just makes them harder to read and understand what you're after. Please, make some effort to determine what is actually needed to show the problem you want to solve, before just posting all of it.
As I've also mentioned before, you are fighting pgfplots
tooth and nail to get the axes to look the way you want, while at the same time, the functions/other things you are plotting don't really need the advanced capabilities of pgfplots
. If you really want this level of control over things pgfplots
tries so hard to hide from you (axis scaling, in this instance), you may find it easier to work in tikz
directly, without involving pgfplots
. Here's some code that gives the output you're after without having to fight pgfplots
' default styling/scaling:
\documentclass[tikz]{standalone}
\tikzset{
axisline/.style={latex-latex},
tickmark/.style={gray},
ticklabel/.style={font=\tiny,fill=white,text=black},
}
\begin{document}
\begin{tikzpicture}[x=0.25in,y=0.001in]
\foreach \y in {500,1000,...,3000} {% y-ticks
\draw[tickmark] (2pt,\y) -- ++(-4pt,0) % draw the tick mark
node[left,ticklabel] {$\pgfmathprintnumber{\y}$}; % label it
}
\foreach \x in {-2,2,4,...,20} {% x-ticks
\draw[tickmark] (\x,2pt) -- ++(0,-4pt) % draw the tick mark
node[below,ticklabel] {$\pgfmathprintnumber{\x}$}; % label it
}
\draw[tickmark] (11.547,2pt) -- ++(0,-4pt) % an extra x tick
node[below,ticklabel] {$20/\sqrt{3}$}; % its label
\draw[axisline] (0,3000) +(0,0.5cm) node[above right] {$y$} -- (0,-100) -- +(0,-0.5cm); % the y-axis
\draw[axisline] (-2,0) +(-0.5cm,0) -- (20,0) -- +(0.5cm,0) node[below right] {$x$}; % the x-axis
\begin{scope}
\clip (-2.1,-100) rectangle (20.1,3000); % "restrict y to domain"
\draw[blue,domain=-2:20,samples=100] plot (\x,400*\x - \x^3);
\end{scope}
\end{tikzpicture}
\end{document}

axis equal image,unit vector ratio={1 100},
?axis equal image,unit vector ratio={1 100},
as you suggested. The graph is fine, but it is too high. The graph occupies 2/3 of a page. With a command likeunit vector ratio={1 250}
orunit vector ratio={1 500}
, I can get a nice graph that does not occupy so much of the page. Do you know why it is not compiling?