# Tag Info

2

beamer has the additional font switch \Tiny that will give you a smaller size than \tiny (if your current font supports this size); if this is not enough, you can use \fontsize{<size>}{<baselineskip>}\selectfont with appropriate values. The code: \documentclass{beamer} \usepackage{etex} \usepackage[frenchb]{babel} \usepackage[T1]{fontenc} ...

0

The issue is due to an incompatibility in the document level javascript code generated by the clickable lib. I resolved and repaired it; the issue will be gone in future versions. The only workaround appears to be decompress the resulting pdf files replace the string super in the argument list of function PGFPlotsClassExtend by something else (for ...

3

The root cause is a bug in pgfplots: apparently, the ticklabel coordinate systems do not work as expected. This morning, I have managed to improve this the polar library such that the default for pgfplots 1.13 will directly result in the label placement as in your screenshot. I will also simplify sloped tick labels and add some more fine tuning to it. For ...

1

Thanks to Gonzalo Medina in this post : plot and fit from pgfplottable, I did manage to do what I wanted. The final code is : \documentclass{beamer} \usepackage{etex} \usepackage[frenchb]{babel} \usepackage[T1]{fontenc} \usepackage[utf8x]{inputenc} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{epstopdf} \usepackage{tikz} ...

3

You need \begin{tikzpicture} \begin{axis} \addplot table [x=new,y=new2] {\loadedtable}; \addplot table[x=new,y={create col/linear regression={y=new2}}] {\loadedtable}; \end{axis} \end{tikzpicture} The complete example: \documentclass{beamer} \usepackage{etex} \usepackage[frenchb]{babel} \usepackage[T1]{fontenc} \usepackage[utf8x]{inputenc} ...

2

Add forget plot to those plots that shouldn't be taken into account for the legend (the first two, in your example). You can use legend style to customize the legend formatting; in your case, you need draw=none to suppress the frame. Using the various coordinate systems provided by pgfplots, you can place elements at any desired location. In the example ...

1

Pass the scale=<factor> option to the axis environment and not to the tikzpicture environment: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{semilogxaxis}[ scale=0.8, xmin=1,xmax=256,grid=both,legend pos=north west, xlabel=Nb. ...

3

Use coordinate (..) at (...); instead of node (..) at (...) {};, then the \draw works as expected. Another way is to change to \draw (A.center) -- (B.center) -- (C.center); while using node, then lines are drawn between the centers of the nodes, rather than edge to edge, as is the default. If you've defined a style in the axis options or with \pgfplotsset ...

0

As percusse said in the comment above, The issue was that I had \usepackage{Pgfplots} rather then \usepackage{pgfplots}.

0

The problem is that the tikzposter class uses (of course) the tikz package. Thus if you use pgfplots, it is loaded after tikz, messing up the layers somehow (according to this thread). My solution is to edit the tikzposter.cls file and change the \usepackage{tikz} to a \usepackage{pgfplots}. As pgfplots also loads tikz, that does the trick for me.

3

You can go the other way as you can read your data and either use it in tabular code or in plotting \documentclass{article} \usepackage{pgfplotstable} \pgfplotsset{compat=1.12} \begin{document} \pgfplotstableread[col sep=ampersand,row sep=\\,header=false]{ 1 & 3.4 \\ 2 & 6.7 \\ 3 & 8.9 \\ 4 & 12.4 \\ 5 & 7.8 \\ }\mytable ...

0

You could use trim axis left and trim axis right as options for the tikzpicture and additionally border={45pt 0pt} as option for the standalone class. The first value inside the class option is the space added to the left and the right border of resulting bounding box of the image. It must be large enough to show the y-label but it could be also larger. In ...

2

Another short solution (run with latex->dvips->ps2pdf): \documentclass[pstricks,border=10pt]{standalone} \usepackage{pst-eucl,pst-plot} \def\iTheta{120} \def\Radius{5} \def\Pb{4} \begin{document} \begin{pspicture}(-5,-1.5)(6.6,6) \psaxes[ticks=none,labels=none,linecolor=black!40]{<->}(0,0)(-5,-1.5)(6.2,5.5)[$x$,0][$y$,90] ...

1

Keeping it fairly simple... \documentclass[tikz,border=5]{standalone} \usetikzlibrary{quotes,angles,arrows.meta,decorations.pathreplacing} \begin{document} \begin{tikzpicture}[>=Latex, line join=round, brace/.style={decorate, decoration={brace, raise=5pt, amplitude=5pt}}] \draw [help lines, <->] (-4,0) -- (4,0) node [at end, right] {$x$}; \draw ...

0

You can try with the optional argument for the subfigure environment, so images will be aligned by the top, bottom or centers. The possible values for the optional argument are b, t, or c. For example, with b: \begin{subfigure}[b]{.45\linewidth} \end{subfigure}\hill \begin{subfigure}[b]{.45\linewidth} \end{subfigure} A different alignment option can be ...

1

A PSTricks solution where the drawing is adjusted according to value of \Angle (which is denoted \theta on the drawing): \documentclass{article} \usepackage{pstricks-add} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n \ExplSyntaxOff %%% Parameter %%% \def\Angle{120} % angle (calculated counterclockwise), measured in degrees, with ...

0

I tried the following : \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colormaps} \pgfplotsset{compat=1.12} \begin{document} \pgfplotsset{width=0.5*\textwidth} \begin{tikzpicture} \begin{axis}[view={60}{240}, colormap/hot] \addplot3+[surf, point meta=explicit] table[x=x, y=y, z=z, meta=r]{out.dat} ; ...

1

The problem is essentially independent of pgfplots as @percusse pointed out in his comment: the graphics are too large to fit into your horizontal space and so TeX breaks the line. I see that your question is actually more than its title: you have three \captions in your figure although figure supports just one. This indicates that my answer might not fit ...

2

This is a weakness of TikZ: it excludes the bounding box of arrow tips from the picture's bounding box. A workaround is to increase the bounding box of the picture artificially, perhaps by increasing it by some manually chosen picture position: \documentclass[10pt]{amsart} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \usetikzlibrary{external} ...

4

Try \documentclass{article} \usepackage{pgfplots} \begin{document} \pgfplotsset{width=0.5*\textwidth} \begin{tikzpicture} \begin{axis}[xlabel={$\theta_o$}, legend pos=south east]%or north west, ... ,outer north east \addplot[mark=none, color=red] coordinates {(0,0) (3,3)}; \addlegendentry{red} ...

2

You can use ycombs and make up a value to draw the verticals. \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ymax=2,ymin=0] \addplot+[ycomb,dashdotted,thick,no marks] table[x=x,y expr=2] { x 1 5 12 34 68 }; \end{axis} \end{tikzpicture} \end{document}

2

I don't know why you want to do this particularly but you can get them consistently positioned by specifying them in the same way as you do for the axis environment: \documentclass[tikz,border=10pt,multi]{standalone} \usetikzlibrary{calc} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis} [ ...

3

If you only want to use the axis environment to draw the axis, then don't try to do anything else with it. Note: the scope is used to shift the origin. I also simplified your angle labels. Later I came back and simplified all of the labels. \documentclass{amsart} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{tikz} ...

0

Okay, after digging around I found functions to create a new column in the table. After doing that, I can do the linear regression on the newly calculated (linearized) column. This may not be the most efficient or elegant code to create the column, but it works. I'm using \pgfplotstableset{create on use ...} to calculate a new column myysquare which is ...

5

Is this the image you are after? After all the discussions and conversations, I think you now got the idea why there were some points misplaced. In brief, that is because the axes are basically used for plotting data points (table) and not dimensions and lengths. So, some conversions are required, e.g., the dimension 6mm may be entered 0.6, etc. So, my ...

4

You cannot straightforwardly use dimensions when specifying coordinates within an axis environment. Since the specification for C doesn't use a dimension, it is correctly placed, but other coordinates are misplaced relative to the intended origin. To see that this is not an effect of TikZ itself, simply remove the axis environment and typeset the remaining ...

2

Here is a pgfplots solution. Based on salim bou's answer. Plot 1 \documentclass[margin=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ axis x line=bottom, axis y line=left, xmin=0, xmax=10, ymin=0, ymax=10, xlabel={Dimension 1}, ylabel={Dimension 2}, ytick=\empty, xtick={0}, ...

4

With tikz First plot \documentclass[margin=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[>=Triangle,thick] \draw[->](0,0)node[below]{$0$}--(6,0)node[below left]{Dimention1}; \draw[->](0,0)--(0,6)node[below left]{Dimention2}; \draw (1.2,5.3) to [bend right=30] coordinate[pos=0.2] ...

2

Actually, there is no room for a legend inside the plot at all. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{pgfplots.statistics} \pgfplotsset{compat=1.12} \usepackage{graphicx} \begin{document} \begin{tikzpicture} \begin{axis}[ legend entries = {A, B}, legend to name={legend}, name=border ] \addplot+[boxplot] table [row ...

1

The col sep key needs to go in the table [...] options, not the \addplot [...] options: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} \begin{axis} \addplot [mark=*,color=red,only marks] table [col sep=comma] {data.csv}; \addplot [mark=none,color=blue] table[y={create ...

4

Setting all the ticks explicitly works: \documentclass[border=2mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[% grid=both, minor tick num=1, xtick={0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, ytick={0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}, ] \end{axis} \end{tikzpicture}% \end{document} I would think this is ...

1

Non-TikZ solutions There is a non-TikZ solution which will make a very tight frame: \node at(axis cs: 2e2,4e2) {\frame{\tiny $k_{\parallel} = k_{\perp}$}}; A not-so-tight frame can be generated with \framebox{...}. TikZ solutions Use \node[draw] as mentioned in darthbith's comment: \node[draw] at(axis cs: 2e2,4e2) {\tiny $k_{\parallel} = k_{\perp}$}; ...

0

finally, and using a 'matlab-translated' version of the python script of Conditionally transparent surface in PGFPLOTS i managed it :) Source code: \documentclass{standalone} \usepackage{xcolor} \definecolor{cr3}{RGB}{177,11,69} \definecolor{cr2}{RGB}{210,210,210} \definecolor{cr1}{RGB}{121,154,153} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...

4

Don't use \nodes for Q and R; use \coordinates instead; a \node has an inner sep and outer sep which cause the problem. The code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{tikz} \usetikzlibrary{matrix,decorations.pathreplacing} \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings} ...

0

6

As this: \documentclass{article} \pagestyle{empty} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture}[scale=.9] % to suppress Overfull \hbox \begin{axis}[axis lines=none,samples=150,domain=-10*pi:10*pi,ymin=-.5, ymax=1.5] \addplot [mark=none]{sin(deg(x-pi))/(x-pi)}; \addplot ...

4

Yes, this is possible. You can use layers to place the elements in the desired order. I initially used \pgfdeclarelayer and \pgfsetlayers but, as percusse mentions in his comment, pgfplots offers set layers which gives a set of predefined layers that can be used to place elements: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...

0

I came up with an solution though i can not judge if this is a "good way" to solve the issue. Comments are appreciated. Instead of appending the unknown keys to /pgfplots/remainingkeys I use a counter to define a seperate style for each \newaddplot The trick is to make sure that the counter is expanded before pgfplots starts scanning for \addplot. The ...

1

Many thanks sergej, for your very valuable answer. I managed to get it running now with all the big data I'm using. Here's the code I applied: \tikzsetnextfilename{temp1C50DOD} \begin{tikzpicture} \begin{axis} [view={0}{90}, xlabel=$x$, ylabel=$y$, colorbar, colorbar style={ title=$^\circ C$, yticklabel style={/pgf/number format/.cd, fixed zerofill, ...

1

Here a solution \documentclass{article} \usepackage{longtable} \usepackage{pgfplots}%\pgfplotsset{compat=1.10} \usepackage{pgfplotstable} \usepackage{lmodern} \usepackage{wasysym} \begin{document} \pgfplotstableread[col sep=comma, header=true]{ age,man,woman 0,30,32 1,40,42 2,30,32 3,36,32 4,33,25 5,34,35 6,26,28 7,16,22 8,30,38 9,21,32 10,22,24 11,29,27 ...

4

I might say "you get what you've asked for". All your axis labels are set with \textsc, which means that you get small caps for lower case letters. These are shaped like upper case letters, but have the height of lower case letters. As such, if you want normal lower case letters, use just Auflösung instead of \textsc{Auflösung}, and similar for the other ...

2

Something like this? The drawback is, you have to adopt the data format. \documentclass[tikz]{standalone} \usepackage{pgfplots, filecontents} \begin{filecontents*}{temp.dat} 0 0 22.93 1 0 22.97 2 0 23.07 3 0 23.11 4 0 23.11 0 1 23.1 1 1 23.05 2 1 23.1 3 1 23.12 4 1 23.12 0 2 23.11 1 2 23.3 2 2 23.3 3 2 23.17 4 2 23.18 0 3 23.08 1 3 23.11 2 3 23.3 3 3 ...

2

Directly scaling a font is not always the best alternative since either the font might turn out to be "too thick" if scaling up by a large factor, or "too thin", if scaling down; the font switches are the right way to change font sizes. That being said, as percusse mentioned in his comment, you can use the scale=<factor> option instead of font in the ...

2

Use the option every tick/.style={black} to control tick color. You can add as many specifications as you want, e.g., color, line width, ..etc. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure} \begin{tikzpicture} \begin{axis}[ axis x line*=bottom, axis y line*=left, xmin=0, xmax=1, ymin=0, ymax=1 ...

2

One way would be to plot the circle and lines with parametric coordinates for \addplot. Your circle and triangle would become \addplot [samples=200,domain=0:360] ({cos(x)},{1+sin(x)}); \addplot [samples at={72,144,288,72}] ({cos(x)},{1+sin(x)}); The labels for the points can be added with e.g. \node at ({cos(72)},{1+sin(72)}) [above right] {$A$}; ...

1

As an alternative you could drop using tikzscale and instead set the width of all the subplots to 0.5\linewidth, by adding every axis/.style={width=0.5\linewidth} to the tikzpicture options. Then use \input{fig.tikz} instead of \includegraphics. (By the way, \matrix is a TikZ thing, and is not specific for pgfplots.) \documentclass{article} ...

2

As Jake said in his comment, the properties to set are point meta min and point meta max on the axis (or groupplot in this case).

3

Like this? Based on page 119 of the manual, I think the problem is that pgfplots is creating a mesh. Of course, it is a very thin mesh, but it ends up drawing the unwanted line. To prevent this, add samples y=0. \documentclass[tikz,border=10pt,multi]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} ...

6

The code from the manual's examples works fine. Yours fails because you have lost a blank line: \documentclass[tikz,border=10pt,multi]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.12} \usepgfplotslibrary{patchplots} \begin{document} \begin{tikzpicture}% 134 \begin{axis}[small,view={0}{90}] \addplot3[surf,shader=interp,patch ...

4

This is why you need to use visualization depends on key and its variants (the manual is pretty clear on this point) with the right marker type: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[ymin=-1,ymax=1, colorbar, visualization depends on=\thisrow{radius}\as\myrad, ...

Top 50 recent answers are included