Tag Info

Hot answers tagged

7

Use axis y line*=right, % and axis y line* = left too instead of axis y line=right, The starred version affects only the axis line leaving other things like positions of axis labels, tick lines etc. Since you are using \pgfplotsset inside the tikzpicture environment, it is better to add ylabel style={rotate=-90}, in it. To remove arrows from axis use ...


7

Here's one option using pgfplots and showing the quadratic interpolation: The code: \documentclass{beamer} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfmathdeclarefunction{mainfunct}{1}{% \pgfmathparse{cos(deg(2*#1))+1.5}% } % The Simpson interpolating function \pgfmathdeclarefunction{Simpsonfunct}{3}{% \pgfmathparse{% ...


4

Here's a pgfplots version (but with no interpolation). Uses gimp to produce the animation (import the resulting pdf as layers, reverse the layers, and export to gif). \documentclass[tikz,border=5]{standalone} \usepackage{pgfplots} \begin{document} \foreach \samples in {3,...,30}{% \begin{tikzpicture}[declare function={f(\x)=sin(\x*180)*100+150;}] ...


4

To avoids expansion issues with \foreach, pgfplots offers \pgfplotsinvokeforeach which can be used without problems; also, you can easily draw your lines from the curve to the axis using the function (no need to find intersections points); declaring the function from the beginning also simplifies the code: The code: \documentclass[border=5]{standalone} ...


4

\documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{loglogaxis}[name=first,domain=1:1000,axis lines=left, enlargelimits=0.2,log ticks with fixed point,xlabel={$x$},ylabel={$y$}, ylabel style={at={(0,1)}, anchor=south,rotate=-90}, xlabel style={at={(1,0)}, ...


4

Do you want something like this? \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \usetikzlibrary{fadings} \tikzfading[name=myfading, bottom color=transparent!100, top color=transparent!0] \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot[blue, name path=A,mark=none] coordinates {(-10,2) (8,2)}; ...


3

Add axis x line*=bottom, ymin=0 to the axis options: \documentclass{scrbook} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width = 12cm, hide y axis, axis x line*=bottom, height = 8cm, bar width=20pt, symbolic x coords={2010, 2011, 2012, 2013, 2014, 2015}, nodes near coords, ...


3

One possibility using legend image code/.code and \addlegendimage to provide the desired variation of the default line legend style: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[legend entries={$f_1$,$f_2$},] \addlegendimage{no markers,green} \addplot [green,domain=-1:1,forget plot] {x}; ...


3

You were on right way ... you need just add style={rotate=-90}, to the second axis, or even better, put it with other common parameters into \pgfplotsset{...} . If you add here set layers, you will obtain borders aroun image without arrows. Slightly rearranged and simplified your code, which generate above image is: \documentclass[border=2mm, ...


2

You need to add table sub family to your style. Table options are required to be the subkey of /table/. Otherwise pgfplots can't understand it and thinks that maybe it is a TikZ key. That's why you have /tikz/meta in the error. Hence you need \pgfplotsset{ table/myStyleWithMeta/.style={ meta=Label, } } then it works


2

I am the author of the template Gabriel uses, and I do make use of overlay and remember picture for the cover page. But I'm pretty sure that the real solution to this problem is to make use of axis cs when specying the nodal points in the plot axis c.s. The pgfplots gallery show multiple uses of this. \node[...] at (axis cs:0.18,0.74,0.08) {...}; (I ...


2

The external PDF contains the drawing instructions for your legend, but since it is excluded from the bounding box, it is clipped away. I believe this is a limitation of PDF (or the way PDF's bounding box is generated in TeX). I think it used to work for dvips, but I might be wrong. A portable way (i.e. one which works for pdftex as well) is to use legend ...


2

An answer is to set whisker range, which determines which points are considered outliers, to a very high value. \documentclass[12pt]{article} \usepackage{pgfplots} \usepackage{filecontents} \pgfplotsset{width=\textwidth, compat=1.12} \usepgfplotslibrary{statistics} %% A value larger than the ratio between any quartile range of any %% boxplot in the ...


2

The correct syntax (or at least a syntax which works) can be seen below: % arara: pdflatex \documentclass[border=5]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[% ,axis lines=left ,xtick=\empty ,ytick=\empty ] \addplot[samples=100,domain=0:10] ...


1

From last paragraph on your question, I understand you want something like this: \documentclass[border=2mm]{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines=left, scaled ticks=false, xtick=\empty, ytick=\empty, ymin=0, ...


1

I wrote some examples of plotting paramaterized paths in pgfplots yesterday: Drawing Functions on Spheres. If you have a closed-form parametric solution, you should be able to plot it and the magnets the same way. You might want to look at quiver plots for the field lines. If you’re saying you want to calculate a Bezier curve from control points and plot ...


1

You can use it as follows: Don't use macro names starting with \the. That is a special case for TeX and might lead to mistakes that are very difficult to debug. \documentclass{article} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} \pgfplotstableread[col sep=comma,header=false]{ ...


1

Here is one example \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[ axis x line=bottom, axis y line=left, xmin=0, xmax=2.5, ymin=0, ymax=2.5, xtick=\empty, ytick=\empty, xlabel=position $x$, ylabel=time $t$, ] \addplot [only marks,mark=*,nodes near ...



Only top voted, non community-wiki answers of a minimum length are eligible