4

I am trying to create a graph using very small numbers and I think I have it working. The problem is that at the bottom left there's an overlay of text that I cannot figure out how to remove. Help would be appreciated. Thanks!

\documentclass{standalone}
%graph and diagrams
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{automata,positioning}

\pgfplotsset{compat=1.17} %remember this line or the graph wont work
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=\linewidth, height=15cm,
    title={$\kappa$ as Determined by Distance and Capacitance},
     xlabel={$Distance: \frac{E_0A}{d}_{(10^{-10} \cdot m^{-2}kg^{-1}s^4A^2)} $},
    ylabel={$Capacitance: C_{(nF)}$},
    label style={font=\small},
    xmin=0, xmax=.0000000007,
     ymin=0, ymax= 0.0000000016,
    xtick={0,.00000000005,...,.0000000007},
    ytick ={0.0000000002, 0.0000000004,..., 0.0000000016},
    legend pos=north west,
    ymajorgrids=true,
    grid style=dashed, %remove for undashed grid%
    tick label style={font=\scriptsize,
                      /pgf/number format/.cd, fixed, fixed zerofill},
    scaled ticks=true,
    yticklabel style={/pgf/number format/precision=1}, 
    xticklabel style={/pgf/number format/precision=1},             ]
%legend
    \legend{$1.777x + 2.7 \cdot 10^{-10}$}
%linear line
\addplot [domain=0:.0000000007, samples=100,color=blue]   {1.777*x + 0.00000000027};
%data points
\addplot +[only marks, mark=oplus, color=black] coordinates
      {(0.0000000000304,0.000000000254) (0.000000000172 ,0.000000001) (0.0000000000369,0.000000000260) (0.0000000000132,0.000000000111) (0.000000000689,0.0000000014)};
      
      
\end{axis}


\end{tikzpicture}
\end{document}

enter image description here

1 Answer 1

8

OP's example throws several errors, of which the first one is

! Package pgfkeys Error: I do not know the key '/pgf/number format/at', to which you passed '(xticklabel cs:0.9,5pt)', and I am going to ignore it. Perhaps you misspelled it.

This is caused by /pgf/number format/.cd used in

    tick label style={font=\scriptsize,
                      /pgf/number format/.cd, fixed, fixed zerofill},

which changes the default path to /pgf/number format. It turns out that pgfplots uses other keys along with the keys passed to tick label style and those "other keys" require the default path unchanged.

Using /pgf/number format/fixed, /pgf/number format/fixed zerofill eliminates the errors as well as the reported "weird number overlay".

PS: When the compilation raises errors, it's better to concentrate on the first error and mention it in question description.

You must log in to answer this question.

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