Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to draw feasible area of the following LP:

\documentclass [11 pt, xcolor=pdftex,x11names,table]{beamer} 
\usepackage{tikz}
\begin{document}
\begin{frame}
    \setbeamercovered{invisible}
    \frametitle{Linear Program}
    \begin{columns}[c]
    \column{0.33\textwidth}
    \begin{tikzpicture}[xscale=0.01,yscale=0.01][domain=-0.5:5000]
        \draw[->] [very thick] (-0.5,0) -- (5000,0) node[right] {$x_1$};
        \draw[->] [very thick](0,-.5) -- (0,5000) node[above] {$x_2$};
% HERE COMES THE REST OF THE GRAPH
\end{tikzpicture}

\column{0.6\textwidth}
    different piece of code
    \end{columns}
\end{frame}
\end{document}

The problem I have is that when I try \begin{tikzpicture}[domain=-0.5:3500] It doesn't fit in a slide. Any suggestion to solve this problem?

EDIT: I edited MWE and used xscale and yscale and I can draw axis but still I get the error Dimention too large \end{frame}. Should I simply ignore this? Any thought?

share|improve this question
4  
you can scale the x with x scale = 0.02 or some small number like that (pass this as another argument after domain=). I would really be a good idea to post the code which includes the figure you are trying to draw. –  Vivi Dec 19 '12 at 23:25
    
or use semilogxaxis environment. –  percusse Dec 19 '12 at 23:52
2  
In my slightly-sleepy state, I expected to see a picture when I compiled your code :) Could you provide the code for the image too? :) –  cmhughes Dec 19 '12 at 23:52
    
@Vivi Thanks for your comments. I updated the question. Any thought? Thanks :-) –  N Nik Dec 20 '12 at 18:27
    
@cmhughes Thanks for your comment. I updated the question. Any thought? Thanks :-) –  N Nik Dec 20 '12 at 18:28

1 Answer 1

up vote 4 down vote accepted

I say if you can't make it, fake it!

You can use values that are 1/1000 smaller than the values you need, and then pretend that the values are bigger when labelling the axes. Have a look at my example:

\documentclass [11 pt, xcolor=pdftex,x11names,table]{beamer} 
\usepackage{tikz}
\begin{document}
\begin{frame}
    \setbeamercovered{invisible}
    \frametitle{Linear Program}

    \begin{columns}[c]
        \column{0.33\textwidth}
        \begin{tikzpicture}[]
            \draw[->] [very thick] (-0.5,0) -- (5,0) node[right] {$x_1$};
            \draw[->] [very thick](0,-.5) -- (0,5) node[above] {$x_2$};
            % Tick marks and labels on the axes
            \foreach \x in {1, 2, 3, 4 } {
                \draw (\x,0)+(90:0.1cm) -- (\x,0) node[below]{\scriptsize $\x 000$};
                \draw (0,\x)+(0:0.1cm) -- (0,\x) node[left]{\scriptsize $\x 000$};
            }
        \end{tikzpicture}

        \column{0.6\textwidth}
        different piece of code
    \end{columns}
\end{frame}
\end{document}

enter image description here

If this doesn't solve your problem, you need to show us your full tikz code. Without that it is hard to give you alternative ways to solve the problem. As Jake said in a comment, pgfplots can deal with larger numbers, and with your full code it wouldn't be hard to transform it into a pgfplots figure.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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