I'm trying to create a plot with pgfplots from CSV file using semicolon as separator and comma as period.  I've tried parsing /pgf/number format/read comma as period as parameter to both \axis and \addplot.   When used in \axis the parameter is ignored and error occurs, indicating need of read comma as period argument.   When used in \addplot I receive :   I'm using MixTex 2.9.6888.  My code:  \documentclass{article} \usepackage{tikz, pgfplots,siunitx} \usepackage[lotdepth]{subfig} \RequirePackage{filecontents}  \begin{filecontents*}{data.csv}     Column1;MERENI;FI2;URMS2     ;1;3,006;17,86     ;2;3,997;20,49     ;3;5,006;22,86     ;4;6,009;25,31     ;5;7,001;27,85     ;6;8,005;30,52     ;7;9,014;33,19     ;8;10,001;35,99     ;9;11,01;38,73     ;10;12,005;41,52 \end{filecontents*}  \begin{document} \begin{figure}     \begin{tikzpicture}         \begin{axis}             [             width=\linewidth,             grid=major,             grid style={dashed,gray!30},             title={mytitle},             ylabel=$U_[ef]$,             xlabel=$f$,             %/pgf/number format/read comma as period,             y unit=\si{\volt},             x unit=\si{\hertz},             ymin = 0, xmin = 0                   ]             \addplot table[x=FI2, y=URMS2, col sep=semicolon, /pgf/number format/read comma as period] {data.csv};     \end{axis}     \end{tikzpicture}  \end{figure}  \end{document}
39431
I am trying to plot data from data files which are using the comma as decimal separator instead of a point (as is normal in SI style (French version):  ). However, even after excessive search I cannot find an option that would actually tell pgfplots to read the table with the comma as decimal separator. Minimal (not) working sample:  \documentclass[paper=a4,12pt,version=last,landscape]{scrartcl} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \centering \begin{tikzpicture}     \begin{axis}[             width=0.9\textwidth,             height=0.5\textheight,             xlabel={Standardweg~[mm]},             ylabel={Standardkraft~[N]},             grid=major,             ]         \addplot table[x=Standardweg, y=Standardkraft] {Messwerte.TRA};     \end{axis} \end{tikzpicture} \end{document}   Messwerte.TRA:  Standardweg  Standardkraft 0,000000000000e+000  1,960904836655e+000 -2,349615044750e-004     3,081407308578e+000 -2,349615044750e-004     4,164415359497e+000 -2,349615044750e-004     5,441759109497e+000 -2,349615044750e-004     6,443712234497e+000 -2,349615044750e-004     7,598009109497e+000 -2,349615044750e-004     8,951524734497e+000 -6,029571522959e-001     1,002574348450e+001 -2,349615044750e-004     1,122496223450e+001 -2,349615044750e-004     1,252183723450e+001   On compilation, I get the error: ! Package PGF Math Error: Could not parse input '-2,349615044750e-004' as a floating point number, sorry. The unreadable part was near ',349615044750e-004'.. for every single number in the .TRA-file.  I know that I could find and replace every , with a . in the files, but that is not an option considering the amount of files I have to evaluate.  Also, I tried stuff like /pgf/number format/use comma, set decimal separator={{,}}, \pgfkeys{/pgf/number format/.cd,fixed,precision=2,use period} and use comma, but none of that helped and I am pretty much running out of options. The documentation for pgfplots did not give any other ideas, either.  So: How do I convince pgfplots to actually read the comma as decimal separator and to not search for the point?
62933
In the following MWE, I'm trying to create one on use column based on the definition of another on use column. PGF generates an error in this case:  PGFPlots: reading {test1.dat} PGFPlots: reading {test2.dat}  ! Package PGF Math Error: Unknown function `value__column_not_found' (in 'value __column_not_found.*0.75').   Although the example (taken from ) is trivial, I would like to keep my original data files separated, but show some of the results together, along with some simple calculations. Is there any way to create a column based on another created column in pgfplotstable?  \documentclass{article} \usepackage{pgfplotstable} \pgfplotstableset{     create on use/lb/.style={         create col/expr={\thisrow{value}*0.75}     }, } \begin{filecontents*}{test1.dat} parameter 1 2 3 4 \end{filecontents*} \begin{filecontents*}{test2.dat} value 0.00034 0.0053 0.07 0.0027 \end{filecontents*} \begin{document} \pgfplotstableread{test1.dat}\parameter \pgfplotstableread{test2.dat}\value \pgfplotstabletypeset[     columns={parameter, value, lb},     columns/parameter/.style={         column name={Parameter},     },     columns/value/.style={         column name={Default Value},     },     create on use/value/.style={create col/copy column from table={\value}{value}},     columns/lb/.style={column name={Lower Bound}}. ]\parameter \end{document}
2695
Some of you may recognize this as Project Euler's problem number 11. The one with the grid.  I'm trying to replicate the grid in a large multidimensional array, But it's giving me a syntax error and i'm not sure why  grid = [  [ 08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08 ], [ 49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 04, 56, 62, 00 ], [ 81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 03, 49, 13, 36, 65 ], ...   And I get this error:     File "D:\development\Python\ProjectEuler\p11.py", line 3     [ 08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91 , 08 ],        ^ SyntaxError: invalid token   Why is it throwing an error before the comma?
106780
I've seen some of the other threads on using strings as x axis labels, but nothing that fits my situation.  I'm trying to create a bar chart from a CSV file. I can do it so long as everything in the data is numeric. However, in my actual data table, the first row is multi-word string descriptions. I need these descriptions to be the x axis labels for each bar.  I've tried symbolic x coords, but I get the "could not parse input as a floating point number" error. I've also tried adding an ID column and using that as the x values, and assigning xtick labels as the string descriptors. I get the same issue that way.  Here's an attempt at an MWE:  \documentclass{article}  \usepackage{lmodern} \usepackage{tikz} \usepackage{pgfplots} \usepackage{pgfplotstable}  \begin{document}  \pgfplotstabletypeset[columns/category/.style={string type},col sep=comma]{Book3.csv} \vspace{1cm}  \begin{tikzpicture} \begin{axis}[ ybar, xlabel=Xstuff, ylabel=Value, symbolic x coords={cat a,cat b,cat c,cat d,cat e,cat f,cat g}, %xtick labels={cat a,cat b,cat c,cat d,cat e,cat f,cat g},% this is from when i tried the xtick label method xtick=data, nodes near coords, nodes near coords align={vertical}] \addplot table[x=category,y=value]{Book3.csv}; %\addplot table[x=category,y=value]{Book3.csv};&amp; again, from trying the xtick label method  \end{axis}  \end{tikzpicture} \end{document}   Since I suspect this might get answered quickly by you chart gurus, I have a follow-up question:  I have to do a bunch of these charts, and I would like to automate the symbolic x coords process. Is there a way to populate the dictionary of accepted x coords by reading a column of the data? (something like symbolic x coords={columns/category/{Book3.csv}} )?  Book3.csv looks like this (ignore the ID column if using the xtick label method):  ID, category, value, value 2 1,  cat a,    1,     7 2,  cat b,    2,     6 3,  cat c,    3,     5 4,  cat d,    4,     4 5,  cat e,    5,     3 6,  cat f,    6,     2 7,  cat g,    7,     1
103740
I'm trying to visualize some data with TikZ datavisualization library. Given foo.tex  \documentclass{article} \usepackage{tikz} \usetikzlibrary{datavisualization}  \begin{document} \begin{tikzpicture}   \datavisualization [ scientific axes, visualize as scatter ] data [ read from file=foo.dat ]; \end{tikzpicture} \end{document}   and foo.dat:  x, y 1, 2 3, 4 5, 6   It fails with the following error (repeated multiple times):  ! Package PGF Math Error: Sorry, an internal routine of the floating point unit got an ill-formatted floating point number `'. The unreadable part was near ''..  See the PGF Math package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.7 ... scatter ] data [ read from file=foo.dat ];   If I'd rather include data from foo.dat inline the document compiles normally.  What am I missing and how can I fix the problem?  I'm running TeXLive 2014 on Windows 7. All files use Unix line ending.  EDIT: I've removed all commas in my data file and explicitly set separator to \space, now it works.  One more quertion: TikZ documentation says:     /pgf/data/separator=&lt;character&gt; (no default, initially ,)   What does this mean? What is the difference between initial value and default value?
22288
I work with CSV files and sometimes need to quickly check the contents of a row or column from the command line.  In many cases cut, head, tail, and friends will do the job; however, cut cannot easily deal with situations such as  "this, is the first entry", this is the second, 34.5   Here, the first comma is part of the first field, but cut -d, -f1 disagrees. Before I write a solution myself, I was wondering if anyone knew of a good tool that already exists for this job.  It would have to, at the very least, be able to handle the example above and return a column from a CSV formatted file.  Other desirable features include the ability to select columns based on the column names given in the first row, support for other quoting styles and support for tab-separated files.  If you don't know of such a tool but have suggestions regarding implementing such a program in Bash, Perl, or Python, or other common scripting languages, I wouldn't mind such suggestions.
30787
How do I make the axis labels use multiples of \pi in PGFPlots?
120706
I want to do the following: I am generating a report which can be set to be in imperial or metric units. All values are originally in metric units, so in the case of imperial units all values should be converted. Some values can be say N/A or any other string value, in case the value is not applicable. The document is automatically generated. For conversion I am using the fp package, but the challenge is the checking the input. The fp package (and pgfmath) will ofcourse) err if you try to do math with non-numerical values. This is what I currently have (only works for integer input)  % Convert meters to inches \newcommand{\convertmtoin}[2] {     \if!\ifnum9&lt;1#1!\else_\fi        \FPeval{val}{#1*39.3700787} \FPround{\val}{\val}{#2}     \else     \def\val{#1}     \fi }   Using pgfmath one could do something like this  \newcommand{\convertmtoin}[2] {     \pgfmathfloatparsenumber{#1}     \pgfmathfloatifflags{\pgfmathresult}{3}{\FPeval{val}{#1*39.3700787} \FPround{\val}{\val}{#2}}{\def\val{#1}}  }   But I am not able to set the error handler of pgfmath to output NaN in the case of erronous input to pgfmathfloatparsenumber  \pgfkeys{/pgf/fpu/handlers/invalid number={??}{??}}   Thanks for any help!
18480
This is a follow-up question to:  (where also the code is taken from)  What I want to achieve (Excel draft):    What I got so far (see code at bottom):    What is missing:   Axis description with "Some Text" Removing the "xxx" hack to get the first column being recognized as strings   Possible solution for removing the "xxx" hack: I found that "automatic column numbering" was done here:  and my dream solution would be not only incorporating it to my heatmap but also extending it with "automatic row numbering".  Current Code:  \documentclass{standalone} \usepackage{colortbl} \usepackage{pgfplots} \usepackage{pgfplotstable}  \pgfplotstableset{     /color cells/min/.initial=0,     /color cells/max/.initial=1000,     /color cells/textcolor/.initial=,     %     % Usage: 'color cells={min=&lt;value which is mapped to lowest color&gt;,      %   max = &lt;value which is mapped to largest&gt;}     color cells/.code={%         \pgfqkeys{/color cells}{#1}%         \pgfkeysalso{%             postproc cell content/.code={%                 %                 \begingroup                 %                 % acquire the value before any number printer changed                 % it:                 \pgfkeysgetvalue{/pgfplots/table/@preprocessed cell content}\value                 \ifx\value\empty                 \endgroup                 \else                 \pgfmathfloatparsenumber{\value}%                 \pgfmathfloattofixed{\pgfmathresult}%                 \let\value=\pgfmathresult                 %                 % map that value:                 \pgfplotscolormapaccess                 [\pgfkeysvalueof{/color cells/min}:\pgfkeysvalueof{/color cells/max}]%                 {\value}%                 {\pgfkeysvalueof{/pgfplots/colormap name}}%                 % now, \pgfmathresult contains {&lt;R&gt;,&lt;G&gt;,&lt;B&gt;}                 %                  % acquire the value AFTER any preprocessor or                 % typesetter (like number printer) worked on it:                 \pgfkeysgetvalue{/pgfplots/table/@cell content}\typesetvalue                 \pgfkeysgetvalue{/color cells/textcolor}\textcolorvalue                 %                 % tex-expansion control                 % see http://tex.stackexchange.com/questions/12668/where-do-i-start-latex-programming/27589#27589                 \toks0=\expandafter{\typesetvalue}%                 \xdef\temp{%                     \noexpand\pgfkeysalso{%                         @cell content={%                             \noexpand\cellcolor[rgb]{\pgfmathresult}%                             \noexpand\definecolor{mapped color}{rgb}{\pgfmathresult}%                             \ifx\textcolorvalue\empty                             \else                             \noexpand\color{\textcolorvalue}%                             \fi                             \the\toks0 %                         }%                     }%                 }%                 \endgroup                 \temp                 \fi             }%         }%     } }  \begin{document}       \vrule\pgfplotstabletypeset[%     color cells={min=365,max=375,textcolor=black},     /pgfplots/colormap={orangewhiteorange}{rgb255=(255,170,0) color=(white) rgb255=(255,170,0)},     /pgf/number format/fixed,     /pgf/number format/precision=0,     col sep=comma,     columns/xxx/.style={reset styles,string type}%     ]{%%%%%%%         xxx, 0, 1, 2, 3, 4, 5, 6         0, 370.8, 371.2, 371.1, 370.9, 371.2, 371.6, 372.0         1, 370.4, 370.3, 370.4, 370.7, 370.8, 371.4, 371.5         2, 370.9, , 370.7, 370.9, 370.8, 371.2, 372.1         3, 371.0, , , 368.1, 371.1, 368.8, 371.3         4, 370.9, , , , 371.1, 371.4, 371.4         5, 371.7, , , , , 371.1, 371.4         6, 372.0, , , , , , 371.2     }\vrule \end{document}   Any help is appreciated!
6157
I have monthly data, and I want to show ticks for, say, each quarter. Thus, instead of showing 12 ticks per year, I want to show 4. There is a very similar post , but the solution is to write the coordinates manually. That is not helpful for me, since my dataset is long. I have tried using the xtick={0,4,...,100} option, but that doesn't skip dates (see plot below).   My MWE is:  \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{pgfplots,tikz} \RequirePackage{filecontents}  \begin{filecontents}{Data1.csv} Period,spot jun 15,1.93 jul 15,2.12 aug 15,2.23 sep 15,1.81 oct 15,1.76 nov 15,1.18 dec 15,1.12 jan 16,1.05 feb 16,1 mar 16,0.9 apr 16,0.75 may 16,1 jun 16,1.15  \end{filecontents}  \begin{document}  \begin{figure}     \centering     \pgfplotsset{table/col sep = comma}     \begin{tikzpicture}         \begin{axis}[             xticklabels from table={Data1.csv}{Period},             xtick={0,2,...,12},             enlarge x limits=0.02,             width=16cm,             height=8cm,             xticklabel style={rotate=45},             ]             \addplot+[smooth] table [x expr=\coordindex, y=spot, col sep = comma] {Data1.csv};         \end{axis}     \end{tikzpicture} \end{figure}  \end{document}
47115
To answer , I would use plot in a foreach loop used into a single path. But it seems that it is impossible...  Here, an example to show my problem:  \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}   \draw   (0,0)   \foreach \myvar in {1,2,3}{     --     plot[domain=0:1] (\myvar-\x,\myvar)   }; \end{tikzpicture} \end{document}   This document should produce this result:    In fact, it produces following error:  ! Package tikz Error: Giving up on this path. Did you forget a semicolon?.   Edit: I add a more complex example to show the problem.  Here, a code without \foreach:  \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}   \draw   (0,0)   --   plot[domain=0:120] ({1-cos(3*\x)},{1-sin(\x)})   --   plot[domain=0:120] ({2-cos(3*\x)},{2-sin(2*\x)})   --   plot[domain=0:120] ({3-cos(3*\x)},{3-sin(3*\x)})   ; \end{tikzpicture} \end{document}   And the result:    And the factorized code with \foreach (but this code produces the error):  \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}   \draw[dahsed]   (0,0)   \foreach \myvar in {1,2,3}{     --     plot[domain=0:120] ({\myvar-cos(3*\x)},{\myvar-sin(\myvar*\x)})   }; \end{tikzpicture} \end{document}
118059
I have a CSV file with data which I want to plot, I can do this by using:  \begin{tikzpicture} \begin{axis} \addplot table [x=n, y=fn, col sep=comma, only marks] {dataratio.csv}; \end{axis} \end{tikzpicture}   This does the job but my dots are colored blue, how do I make them black? Just adding color=black doesn't do anything for me.
21432
Is there an easy way to 'break' the axis in a pgfplots environment? What I'm talking about is something like     Any minimal plot will do as an example...for example  \documentclass{minimal}   \usepackage{tikz} \usepackage{pgfplots}  \begin{document} \begin{tikzpicture} \begin{axis}[ymin=0, ymax=80] \addplot {x*0};  \addplot {x^2+50}; \end{axis} \end{tikzpicture}  \end{document}   For example, in the below plot,    I want to break the axis from around y = 10 to y = 40.   Any ideas? Does PGF have this functionality? A search for `break' in the manual doesn't yield anything.
94870
I have the following problem with pgfplots and \addplot3. I have a graph in [0,1]x[0,1] that should display a mesh plot and a line plot that traces a particular line across the mesh. The line plot is characterized by the following triplet (x, 0.8-x, f(x,y)), which is really (x, 0.8-x, f(x)). In the code below, f(x,y) is called fgm and f(x) is called fgmct.  Here's the working code:  \documentclass{standalone} \usepackage{pgfplots}  \pgfplotsset{compat=1.6}  \begin{document}  \pgfplotsset{ colormap={whitered}{color(0cm)=(white); color(1cm)=(orange!75!red)} }  \begin{tikzpicture}[ scale=1, declare function={fgm(\theta)=1+\theta*(1-2*x)*(1-2*y);}, declare function={fgmct(\theta,\val)=1+\theta*(1-2*x)*(1-2*(\val-x));}]  \begin{axis}[ colormap name=whitered, width=15cm, view={-45}{60}, enlargelimits=false, disabledatascaling, grid=major, domain=0:1, y domain=0:1, samples=30, xlabel=$x_1$, ylabel=$x_2$, zlabel={$f(x_1,x_2)$}, colorbar horizontal, colorbar style={     at={(0,0.9)},     anchor=south west,     width=0.25*\pgfkeysvalueof{/pgfplots/parent axis width},     title={$f(x_1,x_2)$} } ]  \addplot3 [surf] {fgm(-0.5)}; \addplot3 [domain=0:0.8, y domain=0:0.8, samples y=30, black!70, smooth] (x, 0.8-x, {fgmct(-0.5,0.8)});  \end{axis} \end{tikzpicture} \end{document}   Here is what happens:   Seems to me that I should only see the concave line across the surface plot, without the wrap-arounds and the straight line going across it. I would appreciate any pointers as to what I'm doing wrong here.
121494
When using commands that allow using key-value pairs, how can one provide an argument value that has commas in it? As an example, say I'm using the \newacronym command from the glossaries package as below:  \newacronym[firstplural = Alphas, Bravos, and Charlies (ABCs), plural = ABCs]{ABC}{ABC}{Alpha, Bravo, Charlie}   Unfortunately, the comma is used to separate key-value pairs so the Bravos, and Charlies (ABCs) portion doesn't get parsed correctly. Is there a way to overcome this?
113332
I have a .csv file of coordinates that looks like this:        Is there a way for QGIS to plot coordinates formatted like this?  I've tried Adding a Delimited Text Layer... in QGIS, but do not see any options appropriate for this format:  Nxx.xx.xxx Wxxx.xx.xxx   I am able to use a  website to convert that data to Decimal Degrees, Degrees, Minutes &amp; Seconds, and UTM.  For example, inputting N39.56.854 W074.28.013 outputs a latitude of 39.947567, and longitude of -74.466883.  However, I would like to stay in QGIS and make the same conversion.  Things I've tried:   Created a new .csv that has formatting that matches the output of coordinate conversion site mentioned above, and with separated lat-long columns:     However, using the QGIS Add Delimited Text Layer... option yields no visualization of the points.
53196
Why does pgfplots plot functions only until x = 5 and y = 5, but not any further?    \documentclass{article}  \usepackage{tikz} \usepackage{pgfplots}  %%%&lt; \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt} %%%&gt;  \begin{document} \begin{tikzpicture} \begin{axis}[samples=100,ymin=0,ymax=10,xmin=0,xmax=20]  \addplot [thick] plot  (\x,  {1/(1 + exp(-0.6*(\x - 12)))}); \addplot plot (\x, {\x});  \end{axis} \end{tikzpicture} \end{document}