I'm new to this site and I'm searching for the help. I'm trying to plot an adsorption isotherm described with specific equation. I used pgfplots package with following commands:  \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[baseline] \begin{axis}[ ymin=0, ymax=100, xmin=0, xmax=105, ]% \addplot[violet,domain=0:100,samples=999]{((38.25708798*23.0303696*(x/41.77116184))/(1-(x/41.77116184)))*((1-(2.76389715+1)*((x/41.77116184)^2.76389715)+2.76389715*((x/41.77116184)^(2.76389715+1)))/(1+((23.0303696-1)*(x/41.77116184))-23.0303696*((x/41.77116184)^(2.76389715+1))))}; \end{axis} \end{tikzpicture} \end{document}   which leads to the:    The plotted isotherm has an error shape, because the plotted isotherm should be:    Am I missing something, or is it a bug of the PGFPlots package?
122806
I am trying to plot the function 1/x^2 but the result is obviously wrong, here is how it looks like    here is the code  \begin{center}      \begin{tikzpicture}      \begin{axis}[      %xlabel=$x$,     %ylabel={$f(x) = x^2 - x +4$}   ]      \addplot[blue] {1/(x^2)};     \end{axis}     \end{tikzpicture} \end{center}   Any suggestions on how to fix this?
57050
I have the following code: \documentclass[11pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs,siunitx} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} %\usepgfplotslibrary{external} %\tikzexternalize \begin{center} \begin{tikzpicture} \begin{axis}[     title={$x-t$ graph model of LAB 1},     height=10cm,     width=10.2cm,     xlabel={time ($t$)},     ylabel={position ($x$)},     xmin=0, xmax=10,     ymin=0, ymax=12,     xtick={0,1,2,3,4,5,6,7,8,9,10},     ytick={0,2,4,6,8,10,12},     legend pos=south east,     ymajorgrids=true,     grid style=dashed,     legend entries={$x$,$x^2$},         legend style={             at={(1.03,0.5)},             anchor=west} ] \addplot[     color=blue,     mark=square,     ]     coordinates {     (0,0)(1.48,2)(2.76,4)(4.02,6)(5.22,8)(6.43,10)(7.76,12)     }; \addplot[     color=red,     mark=square,     ]     coordinates {     (0,0)(1.66,2)(3.21,4)(4.76,6)(6.32,8)(7.81,10)(9.47,12)     }; \addplot[     color=green,     mark=square,     ]     coordinates {     (0,12)(1.53,10)(2.94,8)(4.53,6)(5.95,4)(7.36,2)(8.83,0)     }; \addplot[     color=black,     mark=square,     ]     coordinates {     (0,12)(1.80,10)(3.46,8)(4.94,6)(6.49,4)(8.20,2)(9.85,0)     }; \legend{Trail 1 (fast and $+$), Trail 2 (slow and $+$), Trail 3 (fast and $-$), Trail 4 (slow and $-$)} \end{axis} \end{tikzpicture} \end{center} \end{document}  which produces the following image:  I am wondering how I am make the above line segments dashed (ie the black, blue, red, green). I want to add a line of best fit over it, so I would like the lines to be dotted. Also, how do you change the text size of the legend? I would like it to be slightly smaller so I am make the graph larger. Thanks!
66812
I am new to pgfplots and would like to get your help on my question. Basically I need to read y value from a file that only contains a list of data (in one column), normalize each value by y=(y-min(Y))/(max(Y)-min(Y)) where max(Y) is the maximum value in the list and min(Y) is the minimum value in the list and plot them. For example, if I have {1,2,3,4} then on the plot, the value of y will be {0, 1/3, 2/3,1}.   I use \addplot table [x expr=\coordindex, y index = 0] {filename}; to draw x and y on the plot. What's the normalization expression for y? Is there existing function to do that? If not, can we extract the max(Y) and min(Y) in pgfplots?
83123
I plot tabular data wherein none of the y-values of the data go above 1.0. In the resulting plot, however, there are a couple of peaks that go beyond 1.0, giving a false impression about those data points:   This is not visible when I plot with marks, but I need to use "no marks" because it is otherwise far too busy (80 points in a small plot).   How can I prevent this?  Update: Per Jake's request, here's a minimal example that shows the described behaviour:  \documentclass{article} \usepackage{pgfplots} \begin{document}     \begin{figure}[ht]         \begin{tikzpicture}             \begin{axis}[no markers, grid=major]                 \addplot coordinates{(0, 0.0000000000)                                      (1, 0.8823529412)                                      (2, 0.8750000000)                                       (3, 1.0000000000)                                       (4, 0.8666666667)                                      (80, 0.0000000000)}[thick];             \end{axis}         \end{tikzpicture}     \end{figure} \end{document}   The problem is less pronounced when I don't make my lines thick, but it is still there (and I want thick lines).
22759
I once already asked a very similar question; . But this is some what different.  I have the following code;  \documentclass{standalone} \usepackage{graphics} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.6} \begin{document} \begin{tikzpicture}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot1]  \end{axis}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.2, ymax=1.2, ylabel={$h(t)$}, ymajorgrids, yminorgrids, name=plot2, at=(plot1.right of north east), anchor=left of north west]  \end{axis}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{o}}(t)$}, ymajorgrids, yminorgrids, name=plot4, at=(plot1.below south west), anchor=above north west]  \end{axis}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=2000, ymax=12000, ylabel={$p_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot5, at=(plot4.right of north east), anchor=left of north west]  \end{axis}  \end{tikzpicture} \end{document}   This creates the following plot:    I think there is to few vertical/horizontal spacing between the plots. I want to increase this. Currently I use x- yshift, this gives the following result:  \documentclass{standalone} \usepackage{graphics} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.6} \begin{document} \begin{tikzpicture}  \begin{axis}[% width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot1]  \end{axis}  \begin{axis}[% xshift=1cm, width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.2, ymax=1.2, ylabel={$h(t)$}, ymajorgrids, yminorgrids, name=plot2, at=(plot1.right of north east), anchor=left of north west]  \end{axis}  \begin{axis}[% yshift=-1cm, width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=0.0004, ymax=0.0012, ylabel={$\phi_{\mathrm{o}}(t)$}, ymajorgrids, yminorgrids, name=plot4, at=(plot1.below south west), anchor=above north west]  \end{axis}  \begin{axis}[% xshift=1cm, width=3cm, height=3cm, scale only axis, every x tick label/.append style={font=\scriptsize\color{gray!80!black}}, xmin=0, xmax=20000, xlabel={$t$}, xmajorgrids, xminorgrids, every y tick label/.append style={font=\scriptsize\color{gray!80!black}}, ymin=2000, ymax=12000, ylabel={$p_{\mathrm{i}}(t)$}, ymajorgrids, yminorgrids, name=plot5, at=(plot4.right of north east), anchor=left of north west]  \end{axis}  \end{tikzpicture} \end{document}     I want to know if there is a more consistent manner to do this.
35194
I use pgfplots for most of my plots. Now I need to add a . Is this possible with pgfplots or any other package?
8898
Today I downloaded and installed the new  package to draw Feynman diagrams. I included the packages   \usepackage{tikz}  \usepackage{tikz-feynman} \tikzfeynmanset{compat=1.0.0} \usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}   into my preamble (changed them already many times).  However, already a simple sample code like  \begin{tikzpicture} \begin{feynman} \vertex (a) {\(\mu^{-}\)}; \vertex [right=of a] (b); \vertex [above right=of b] (f1) {\(\nu_{\mu}\)}; \vertex [below right=of b] (c); \vertex [above right=of c] (f2) {\(\overline \nu_{e}\)}; \vertex [below right=of c] (f3) {\(e^{-}\)}; \diagram* { (a) -- [fermion] (b) -- [fermion] (f1), (b) -- [boson, edge label'=\(W^{-}\)] (c), (c) -- [anti fermion] (f2), (c) -- [fermion] (f3), }; \end{feynman} \end{tikzpicture}   directly gives the error:     Package pgfkeys Error: I do not know the key '/graph drawing/node distance'.   Can you please help me? Thanks in advance!
74599
I tried to export my Geogebra graphs into tikz-code. In General it works fine, but plot x^1/3 doesn't work:  \documentclass[10pt]{article} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{ccqqqq}{rgb}{0.8,0,0} \definecolor{qqttcc}{rgb}{0,0.2,0.8} \definecolor{cqcqcq}{rgb}{0.75,0.75,0.75} \begin{tikzpicture}[line cap=round,line join=round,&gt;=triangle 45,x=1.0cm,y=1.0cm] \draw [color=cqcqcq,dash pattern=on 1pt off 1pt, xstep=1.0cm,ystep=1.0cm] (-4,-4) grid (4,4); \draw[-&gt;,color=black] (-4,0) -- (4,0); \foreach \x in {-4,-3,-2,-1,1,2,3} \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$}; \draw[-&gt;,color=black] (0,-4) -- (0,4); \foreach \y in {-4,-3,-2,-1,1,2,3} \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$}; \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$}; \clip(-4,-4) rectangle (4,4); \draw[color=qqttcc, smooth,samples=100,domain=-4.0:4.0] plot(\x,{(\x)*(\x)*(\x)}); \draw[color=ccqqqq, smooth,samples=100,domain=-4.0:4.0] plot(\x,{((\x))^(1/(3))}); \draw [color=qqttcc](2.06,4.18) node[anchor=north west] {$f(x)=x^3$}; \draw [color=ccqqqq](2.06,1.18) node[anchor=north west] {$f(x)=\sqrt[3]{x}$}; \begin{scriptsize} \draw[color=qqttcc] (-1.74,-7.16) node {$f$}; \end{scriptsize} \end{tikzpicture} \end{document}      Error line 21: !Missing number, treated as zero.   So plot has problems with the negative x I suppose, but I don't know. Any help would be great! I googled it for nearly 1 hour - but no real answers.  As suggestet it rotated and mirrored the graph - works great!:  \documentclass[10pt]{article} \usepackage[utf8]{inputenc} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{ccqqqq}{rgb}{0.8,0,0} \definecolor{qqttcc}{rgb}{0,0.2,0.8} \definecolor{cqcqcq}{rgb}{0.75,0.75,0.75} \begin{tikzpicture}[line cap=round,line join=round,&gt;=triangle 45,x=1.0cm,y=1.0cm] \draw [color=cqcqcq,dash pattern=on 1pt off 1pt, xstep=1.0cm,ystep=1.0cm] (-4,-4) grid (4,4); \draw[-&gt;,color=black] (-4,0) -- (4,0); \foreach \x in {-4,-3,-2,-1,1,2,3} \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize \x}; \draw[-&gt;,color=black] (0,-4) -- (0,4); \foreach \y in {-4,-3,-2,-1,1,2,3} \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize \y}; \draw[color=black] (0pt,-10pt) node[right] {\footnotesize 0}; \clip(-4,-4) rectangle (4,4); \draw[color=qqttcc, smooth,samples=100,domain=-4.0:4.0] plot(\x,{(\x)*(\x)*(\x)}); \begin{scope}[yscale=-1,xscale=1] \draw[rotate=90, color=ccqqqq, smooth,samples=100,domain=-4.0:4.0] plot(\x,{(\x)*(\x)*(\x)}); \end{scope} \draw [color=qqttcc](2.06,4.00) node[anchor=north west] {$f(x)=x^3$}; \draw [color=ccqqqq](2.06,1.00) node[anchor=north west] {$f(x)=\sqrt[3]{x}$}; \begin{scriptsize} \draw[color=qqttcc] (-1.74,-7.16) node {f}; \end{scriptsize} \end{tikzpicture} \end{document}
88334
See this example code:  \documentclass{article}  \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document}   \begin{tikzpicture}     \begin{axis}[                  xmin=-0.1,                  xmax=1.1,                  ymin=-1.1,                  ymax=1.1,                  domain=0:1,                  samples=30                 ]       \addplot[blue] {sqrt(x)};       \addplot[purple] {-sqrt(x)};     \end{axis}   \end{tikzpicture} \end{document}   The result appears acceptable far from zero, but near zero it's too much undersampled:    Increasing samples value makes the plot nice, but it considerably slows down processing. As a workaround I could just plot the inverse in a parametric plot (i.e. (y^2,y)), but in my actual code it'd require quite a bit of additional work.  Is there a way to provide a custom sampling function or specify different density of samples in different parts of the domain?
14593
I want to do a simple graph, where its points will be assigned by a list (NOT a file) of coordinates.  So, I know, that I can do something like this:  \addplot gnuplot [raw gnuplot, color=blue]{plot "test.dat" };   But I need to use it like this:  \addplot gnuplot [raw gnuplot, color=blue]{plot { (0,0)(1,5)(10,12) } };   It looks pretty easy, but I'm somehow not able to find a single mention of using Pgfplots with gnuplot like this.  So, is it even possible to use it like that? And if it is, then how?
25020
I want to draw a voronoi diagram with pgfplots, but sadly I cannot get it the way it should look like. I used the Matlab command to get the x and y coordinates and saved them as a dat-file. In that file I stored the x coordinates in the first column and the y coordinates in the second column.      Does anyone have an idea, how it could work?  Minimal Example of the Code:  \documentclass{standalone}  \usepackage{amsmath,amsfonts,amssymb}  \usepackage{mathtools}  \usepackage[ngerman]{babel}  \usepackage[utf8]{inputenc}  \usepackage{graphicx}  \usepackage[svgnames]{xcolor}  \usepackage{pgfplots} \pgfplotsset{compat=newest}  \usepackage{tikz}  \usetikzlibrary{positioning,fit,calc,shapes,arrows,external,3d,patterns,spy}  \usepackage{filecontents}  \begin{document}  \begin{filecontents*}{data.dat}   -7.9265104e+00   3.6503989e-01    4.3133971e-01   9.4062409e-01   -7.9265104e+00   3.6503989e-01    6.3976919e-02   5.4947497e-01    6.3976919e-02   5.4947497e-01    3.0293735e-01   6.5037024e-01    3.6748619e-01   9.5786833e-02    6.3976919e-02   5.4947497e-01    3.0293735e-01   6.5037024e-01    4.0645496e-01   8.2958752e-01    4.9066479e-01   4.4410036e-01    3.0293735e-01   6.5037024e-01    3.6748619e-01   9.5786833e-02    4.9244296e-01   2.3488102e-01    4.9244296e-01   2.3488102e-01    4.9066479e-01   4.4410036e-01    4.9066479e-01   4.4410036e-01    7.3082954e-01   5.1825327e-01    1.8829507e+00   1.7053562e-01    4.9244296e-01   2.3488102e-01    4.3133971e-01   9.4062409e-01    8.7230061e-01   2.0371867e+00    4.0645496e-01   8.2958752e-01    4.3133971e-01   9.4062409e-01    6.6251849e-01   6.4842135e-01    4.0645496e-01   8.2958752e-01    6.9696115e-01   6.8938388e-01    8.7230061e-01   2.0371867e+00    7.3082954e-01   5.1825327e-01    6.6251849e-01   6.4842135e-01    1.8829507e+00   1.7053562e-01    7.3082954e-01   5.1825327e-01    6.6251849e-01   6.4842135e-01    6.9696115e-01   6.8938388e-01   -7.9265104e+00   3.6503989e-01   -1.7371176e+01   8.6111447e-02    3.6748619e-01   9.5786833e-02   -6.0998602e-02  -1.3709259e+00    1.8829507e+00   1.7053562e-01    4.4291165e+00  -2.9045575e-01    8.7230061e-01   2.0371867e+00    1.8287612e+00   4.5227847e+00    6.9696115e-01   6.8938388e-01    1.9370861e+00   1.3452721e+00 \end{filecontents*}  \begin{tikzpicture} \begin{axis}[x=3cm, y=3cm, z=0cm, view={0}{90}] \addplot3 [color=blue, samples y=0] file {voronoi.dat};  \end{axis} \end{tikzpicture}  \end{document}   Thanks for your help!!
39009
I recently ran into scaling problems with the very nice pgfplots library fillbetween. See the following example, which is perfectly fine:  \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \pgfplotsset{compat=newest}  \begin{document}  \begin{tikzpicture}[scale=1.0]  \begin{semilogxaxis}[xmin=1,xmax=256,grid=both,legend pos=north west,             xlabel=Nb. of sub-domains,ylabel=Number of neighbors,legend cell align=left,             every axis y label/.style={at={(ticklabel cs:0.5)},rotate=90,anchor=near ticklabel},             xtick={1,2,4,8,16,32,64,128,256},xticklabels={1,2,4,8,16,32,64,128,256}] \legend{Min., Max., Average};  \addplot[color=blue,very thick,mark=*,name path=A] coordinates { (1,0) (2,1) (4,3) (8,4) (16,3) (32,3) (64,4) (128,4) (256,5) }; %Min \addplot[color=gray,very thick,mark=*,name path=B] coordinates { (1,0) (2,1) (4,3) (8,6) (16,9) (32,12) (64,15) (128,15) (256,16)}; %Max \addplot[color=black,very thick,mark=*] coordinates { (1,0) (2,1) (4,3) (8,5.5) (16,6.12) (32,7.88) (64,9.59) (128,10.50) (256,11.37)}; %Avg \addplot[orange,opacity=0.4] fill between[of=A and B];  \end{semilogxaxis}  \end{tikzpicture}   \end{document}     Now, I just change scale=1.0 to scale=0.8, and I obtain the following result:    Note that if I comment the "fillbetween" line in the code, everything works fine when scaling the picture. Does anyone has an idea about this ?  Cheers
83714
I am using pgfplots to plot the a function. I have been looking around on the forums, but I could  not find a solution. I would like to origin to be indicated as a 0 on the x axis.  I would also like to get the axis labels to appear respectively left and below the axis. Any ideas?  I have the following plot:   \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}   \begin{axis}[width=7cm, height=2cm,xmin=-6,xmax=6,ymin=0,ymax=1, no markers, samples=50, axis lines=left,  axis lines=middle,  scale only axis, % extra y ticks={0.5}, /pgfplots/ytick={0, 0.5,1}, % make steps of length 0.5 /pgfplots/xtick={-5,0,5}, % make steps of length 5     xlabel=$Li$,     ylabel={$f_{comp}(Li))$}   ]      \addplot {1/(1+exp(-x)};    \end{axis} \end{tikzpicture} \end{document}
105905
After reading a question on "",  I have a code like this that refers to the inequalities    \documentclass{article} \usepackage{mathtools} \usepackage{amssymb} \usepackage{MnSymbol} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{intersections} \usetikzlibrary{patterns}  \makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother \pgfplotsset{only axis on top/.style={axis on top=false, after end axis/.code={              \pgfplotsset{axis line style=opaque, ticklabel style=opaque, tick style=opaque,                           grid=none}\pgfplotsdrawaxis}}}  \newcommand{\drawge}{-- (rel axis cs:1,0) -- (rel axis cs:1,1) -- (rel axis cs:0,1) \closedcycle} \newcommand{\drawle}{-- (rel axis cs:1,1) -- (rel axis cs:1,0) -- (rel axis cs:0,0) \closedcycle}  \begin{document} \begin{figure}[ht] \centering \begin{tikzpicture} \begin{axis}[axis line style=thin, axis x line=center, axis y line=center, ymin=-7, ymax=7, xmin=-7, xmax=7, xlabel=\(x\), ylabel=\(y\), grid=minor] \addplot[name path global=line1, pattern=north west lines, color=blue!50, thick, domain=-7:7]{3*x-5}; \addplot[name path global=line2, pattern=north west lines, color=blue!50, thick, domain=-7:7]{6-2*x}; \addplot [draw=none, pattern=northeast lines, pattern color=blue!40, domain=-7:7]{3*x-5} \drawle; \addplot [draw=none, pattern=northeast lines, pattern color=blue!40, domain=-7:7]{6-2*x} \drawge; \end{axis} \end{tikzpicture} \end{figure}   \end{document}   which looks like    I want it to look like   , where the graph is filled only where all the inequalities hold true. NOTE the two graphs are entirely different problems. I only want the style, not the question.  However, the code for the latter image uses intersections:  \begin{figure}[ht] \centering \begin{tikzpicture}     \begin{axis}[axis line style=thin,     axis x line=center,     axis y line=center,     ymin=-6, ymax=7, xmin=-6, xmax=11, xlabel=\(x\), ylabel=\(y\), grid=minor]     \addplot[name path global=line1, color=blue!50, thick, domain=-5:10]{5/3-x/3};     \addplot[name path global=line2, color=blue!50, thick, domain=-5:10]{x/5-10/7};     \addplot[name path global=line3, color=blue!50, thick, domain=-5:10]{6*x+10};     \fill[name intersections={of=line1 and line2,by=point1}, name intersections={of=line1 and line3,by=point2}, name intersections={of=line2 and line3,by=point3}][very thick, pattern=northeast lines, draw=blue!60, pattern color=blue!30!cyan](point1)--(point2)--(point3)--(point1);     \end{axis} \end{tikzpicture} \end{figure}   The first image has only one intersecting point, hence I cannot use this method. I also don't want other areas shaded- only the final areas where the lines intersect. Is there a way around it without to find the points in which the lines intersect the border of the grid, meaning I have to manually compute the points?  EDIT: added the inequalities for the graph.
86390
Why doesn't the pos = x option work when the node is used in the plot command?  \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}   \draw plot[domain = 0:2, samples = 100] ({\x}, {(\x)^2}) node[pos = 1.1]    {\(y = x^2\)}; \end{tikzpicture} \end{document}   In this picture, f_{quad} is my node that should be at pos = 1.1.    Additionally, it doesn't matter what I make pos equal to.  It is always at the origin.
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?
63994
I am trying to locate the vertices of a rectangle and to color the rectangular region.  I specify the y-coordinate as a function value, like \sqrt{3}/2 or \sin(60).  I am getting an error.  \documentclass{amsart} \usepackage{tikz} \usetikzlibrary{calc}   \begin{document} \begin{tikzpicture}  \coordinate (A) at (-1,{-\sqrt{3}/2}); \coordinate (B) at (-1,{\sin(60)}); \coordinate (C) at (2,{\sin(60)); \coordinate (D) at (2,{-\sqrt{3}/2});  \path[fill=yellow] (A) -- (B) -- (C) -- (D) -- cycle;  \node[outer sep=0pt,circle, fill,inner sep=1.5pt,label={[fill=white]below left:$A$}] at (A) {}; \node[outer sep=0pt,circle, fill,inner sep=1.5pt,label={[fill=white]above left:$B$}] at (B) {}; \node[outer sep=0pt,circle, fill,inner sep=1.5pt,label={[fill=white]above right:$C$}] at (C) {}; \node[outer sep=0pt,circle, fill,inner sep=1.5pt,label={[fill=white]below right:$D$}] at (D) {}; \end{tikzpicture}