# LaTeX: plotting function, formatting axis

I've got some problems with plotting a function in a diagram with logarithmic axis: I doesnt give me any errors, but I don't see a graph. Do I need to include any other package?

\begin{tikzpicture}
\begin{loglogaxis}
xmin=10,xmax=100,
ymin=10,ymax=10000,
grid=both,
tick align=outside,
tickpos=left,
]

[only marks,color=blue,mark=*]
coordinates{
(75,105)
(57,370)};
[only marks,color=blue,mark=x]
coordinates{
(40,1900)};

\end{loglogaxis}
\end{tikzpicture}


The next thing is, that I want the x-axis to have a logarithmic grid (for examples in steps of 10) but just one label at 10^2. I tried a lot, but nothing really worked out ...

Maybe you could help me?

• Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. Commented May 27, 2013 at 12:27
• Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Commented May 27, 2013 at 12:29
• The plot does not show up because its domain (that is, the range over which it is evaluated) is outside the visible axis range. If you set domain=10:100 and remove the ymax setting, you can see your graph. However, I think something's wrong with your equation: Over this x range, the graph's y values range from 1e6 to 1e16, so well outside the range of your data.
– Jake
Commented May 27, 2013 at 12:44
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Commented May 28, 2013 at 10:47

Remove xmin/xmax, ymin/ymax options and you'll get it.

Use domain instead if you want to restrict the plots.

A bit of detective work shows that your function 10^(-4.59)*x^10.627 takes no values in your ordinate range, for x in [10,100]: it's an increasing function and its values at x=10 and x=100 are about 10^6 and 4.6*10^{16}, respectively, which both lie outside [10,1000].

Therefore, you must change the values passed to xmin, xmas, ymin, ymax in order to "see" that plot.

Regarding your second question, you can set the tick labels manually, using xticklabels={<comma separated list>} and yticklabels={<comma separated list>}.

Edit: Jake's comment already says it all; I only saw it after posting this answer.

• Thanks alot, first thing: stupid problem, i accidently switched the exponents. After that, the plot is visible.
– Flo
Commented May 27, 2013 at 19:18