0

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}
[xlabel={Temperatur [Grad]},ylabel={Zeit [h]},
xmin=10,xmax=100,
ymin=10,ymax=10000,
grid=both,
tick align=outside,
tickpos=left,
]
\addplot {10^(-4.59)*x^10.627};

\addplot
[only marks,color=blue,mark=*]
coordinates{
(75,105)
(57,370)};
\addplot
[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?

4
  • Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format.
    – jub0bs
    May 27, 2013 at 12:27
  • 1
    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}. May 27, 2013 at 12:29
  • 2
    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
    May 27, 2013 at 12:44
  • 1
    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.
    – jub0bs
    May 28, 2013 at 10:47

2 Answers 2

2

Remove xmin/xmax, ymin/ymax options and you'll get it. enter image description here

Use domain instead if you want to restrict the plots.

2

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .