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 created this graph. The graph is shown correctly but I need the range on the y-axis to be from 10e-8 to 1. I would also like a grid. I'm a newbie with the pgfplots package.

\begin{figure}[htp]
\centering
\begin{tikzpicture}
\begin{semilogyaxis}[xlabel=distanza]
\addplot [domain=0.0000001:1,
          thick,blue]
    file {./MATLAB/file.txt};
\end{semilogyaxis}
\end{tikzpicture}
\end{figure}
share|improve this question

1 Answer 1

up vote 5 down vote accepted

If I understand your question correctly, you can use ymin=, ymax= to define the y-axis limits (everything outside of the axis limits will be clipped away). For the grid, you have the grid= option; a simple example:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{figure}
\centering
\begin{tikzpicture}
\begin{semilogyaxis}[ymin=0.000000001,ymax=1,xlabel=distanza,grid=major]
\addplot [thick,blue]
    coordinates {(1,0.0000001) (2,0.0065) (3,0.1) (4,0.9)};
\end{semilogyaxis}
\end{tikzpicture}
\end{figure}

\end{document}

enter image description here

share|improve this answer
    
Yeah...thanks so much... –  Mazzy Dec 11 '12 at 23:23
    
Does it exist a way to get a plot bigger? –  Mazzy Dec 11 '12 at 23:26
1  
@Mazzy you can specify a width using, for example width=13cm, as an option to the semilogyaxisas in \begin{semilogyaxis[ymin=0.000000001,ymax=1,xlabel=distanza,grid=major,width=12‌​cm] or globally, using something like \pgfplotsset{width=10cm} in the preamble. –  Gonzalo Medina Dec 11 '12 at 23:30
    
Great fantastic...you are so nice...Thank you –  Mazzy Dec 11 '12 at 23:33
1  
@Mazzy You're welcome! –  Gonzalo Medina Dec 11 '12 at 23:33

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.