3

I'm using pgfplots to plot several plots throughout my thesis, and I'm about half way and already the editor is having issues with loading the log file. Can anyone suggest a way I can reduce this? The error I get is "coordinate (,) has been dropped because of a coordinate filter. (see also unbounded coords=jump)." All my plots are added using pgfplots, so I really don't want to go back and import them as images (particularly because they wont look quite as good!). I'm using TeXstudio Here is a sample of the code for one of my plots;

\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfplotstable} 
\usepackage{tikz}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units} 
\begin{document}
\begin{figure}[h!]
    \begin{center}
    \begin{tikzpicture}
    \begin{axis}[ytick pos=left,xtick pos=left,
    %title=Particle size variation as a func. of CTA concentration,
    xlabel = $\dot{\gamma}$,
    ylabel = $\eta$,
    y unit=\si{\pascal\second},
    x unit=\si{\second^{-1}},
    %ymin=55,
    %ymax=70,
      ymode=log,
        log ticks with fixed point,
      xmode=log,
        log ticks with fixed point,
        % for log axes, x filter operates on LOGS.
        % and log(x * 1000) = log(x) + log(1000):
        %x filter/.code=\pgfmathparse{#1 + 6.90775527898214},
    legend style={draw=none},legend pos = outer north east, %outer if you like
    %width=300,height=280,
    width=340,height=230,
    %axis lines=left,
    enlargelimits=.1 % <- adds 10% of the axis range on both sides
    ]
    \addplot[only marks,mark = *,mark size=2,]table [x=B18x,y=B18y,col sep=comma,]{barea.csv};
    \addlegendentry{15 vol\%}
    \addplot[only marks,mark = diamond*,blue,mark size=2,]table [x=B16x,y=B16y,col sep=comma,]{barea.csv};
    \addlegendentry{14 vol\%}
    \addplot[only marks,mark = triangle*,green,mark size=2,]table [x=B14x,y=B14y,col sep=comma,]{barea.csv};
    \addlegendentry{12 vol\%}
    \addplot[only marks,mark = pentagon*,yellow,mark size=2,]table [x=B10x,y=B10y,col sep=comma,]{barea.csv};
    \addlegendentry{8 vol\%}
    \addplot[only marks,mark = asterisk,orange,mark size=2,]table [x=B6x,y=B6y,col sep=comma,]{barea.csv};
    \addlegendentry{5 vol\%}
    \addplot[only marks,mark = +,red,mark size=2,]table [x=B2x,y=B2y,col sep=comma,]{barea.csv};
    \addlegendentry{2 vol\%}
    \addplot[only marks,mark = o,mark size=2,]table [x=B18xh,y=B18yh,col sep=comma,]{barea.csv};
    \addplot[only marks,mark = diamond,blue,mark size=2,]table [x=B16xh,y=B16yh,col sep=comma,]{barea.csv};
    \addplot[only marks,mark = triangle,green,mark size=2,]table [x=B14xh,y=B14yh,col sep=comma,]{barea.csv};
    \addplot[only marks,mark = pentagon,yellow,mark size=2,]table [x=B10xh,y=B10yh,col sep=comma,]{barea.csv};
    \addplot[only marks,mark = star,orange,mark size=2,]table [x=B6xh,y=B6yh,col sep=comma,]{barea.csv};
    \addplot[only marks,mark = x,red,mark size=2,]table [x=B2xh,y=B2yh,col sep=comma,]{barea.csv};
    \addplot[mark=none,domain=0:4]table [x=B18xc,y=B18yc,col sep=comma,]{barea.csv};
    \addplot[mark=none,domain=0:4]table [x=B16xc,y=B16yc,col sep=comma,]{barea.csv};
    \addplot[mark=none,domain=0:4]table [x=B14xc,y=B14yc,col sep=comma,]{barea.csv};
    \addplot[mark=none,domain=0:4]table [x=B10xc,y=B10yc,col sep=comma,]{barea.csv};
    \addplot[mark=none,domain=0:4]table [x=B6xc,y=B6yc,col sep=comma,]{barea.csv};
    \addplot[mark=none,domain=0:4]table [x=B2xc,y=B2yc,col sep=comma,]{barea.csv};
    \addplot[only marks,mark = x,orange,mark size=2,]table [x=B1x,y=B1y,col sep=comma,]{barea.csv};
    \addplot[mark=none,domain=0:4]table [x=B1xc,y=B1yc,col sep=comma,]{barea.csv};
    \end{axis}
    \end{tikzpicture}
    \caption{Bare}
    \label{fig:Bare}
    \end{center}
    \end{figure}
    \end{document}

Is there anyway to work around this issue? Please excuse me if this is a silly question - I'm relatively new to latex!

Link to csv file I use for this

  • 1
    Welcome to TeX SX! You can import them a pdf images to have the same quality. – Bernard Mar 29 '18 at 19:07
  • 1
    It is not possible to run your document as posted, what is in the log file that is making it large? – David Carlisle Mar 29 '18 at 19:10
  • 1
    How many images do you have? I have a ~1,000pg document with ~1,000 pgf images, and it doesn't cause any problems (I wouldn't want to browse through the log, but my editor doesn't choke). My guess would be that you have something that's adding warnings to the log file. – Teepeemm Mar 29 '18 at 19:19
  • 1
    Perhaps you want to change your editor... – Skillmon likes topanswers.xyz Mar 29 '18 at 19:19
  • 2
    ... or use externalize... – user121799 Mar 29 '18 at 19:41
4

You are probably supposed to access this via a pgf key, but I didn't see it but you can turn off the filter logging by adding

\makeatletter
\pgfplots@warn@for@filter@discardsfalse
\makeatother

to your preamble after loading the package.

Note your example produces the error

! Undefined control sequence.
\pgfk@/pgfplots/x unit ->\si 
                             {\second ^{-1}}
l.61     \end{axis}

But that seems unrelated.

| improve this answer | |
3

I'd probably use externalize, i.e add

\usepgfplotslibrary{external}
\tikzexternalize

to the preamble of your document, see section 3.2.6 of the pgfplots manual. Then you'd have the large log file only once and also save some amount of time in the subsequent compilations.

| improve this answer | |
0

Your example (without \si) gives me a 1.4MB log file that is 26858 lines long. 26244 of those lines come from 13122 instances of the two lines

NOTE: coordinate (,) has been dropped because of a coordinate filter. (see also
 unbounded coords=jump). 

So about 98% of the log's lines are because of this.

But your CSV is really many pairs of columns that just happen to be in the same file. It's something like:

B18x,B18y,B16x,B16y,B14x,B14y
   1,   2,   3,   4,   5,   6
   7,   8,   9,  10,    ,
  11,  12,    ,    ,    ,

You never do anything with B18y and B16x at the same time, for example. In fact, you have 20 pairs of columns, which you read into 20 different plot commands. However, your CSV has 13122 blank coordinate pairs, which is suspiciously close to the number of warnings.

So the proper way would be to separate the different data into different files (probably within their own subdirectory, for sanity). Then you would load B18.csv with only columns B18x and B18y, and you would load B18h.csv with only columns B18xh and B18yh.

But if you don't want to create 20 different files, you can add

filter discard warning=false,

to the axis options. This gets the log file down to 614 lines. The downside is that if you discard what should have been a valid point, you won't find out about it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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