# Tag Info

17

MWE with Asymptote, file lattice.asy: size(200); import graph3; pen surfPen=rgb(1,0.7,0); pen xarcPen=deepblue+0.7bp; pen yarcPen=deepred+0.7bp; currentprojection=perspective(5,4,4); real R=2; real a=1; triple fs(pair t) { return ((R+a*Cos(t.y))*Cos(t.x),(R+a*Cos(t.y))*Sin(t.x),a*Sin(t.y)); } surface s=surface(fs,(0,0),(360,360),8,8,Spline); ...

15

Are you thinking about something like this? \documentclass{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=10cm,height=10cm] import graph3; import three; size3(200); currentprojection=orthographic(3,3,5); currentlight=light(gray(0.4),specularfactor=3,viewport=true, (-0.5,-0.25,0.45),(0.5,-0.5,0.5),(0.5,0.5,0.75)); int nb ...

8

You have to expand \c (but I'd use a different name) before \addplot sees it: \documentclass{article} % TIKZ & PGF \usepackage[usenames,dvipsnames,svgnames]{xcolor} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{tikz} \usetikzlibrary{backgrounds, decorations.shapes, decorations.markings, shapes, patterns} % % % % % % % % CIRCLES % % % ...

7

This is the best I've found but I don't know if you'll find it easy enough. It's more or less the same effort required to define a color. \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \pgfmathsetmacro{\a}{1} \pgfmathsetmacro{\yshift}{1} \foreach \i in {0.25,0.5,...,1} {% ...

6

It is known that PGFPlots and \foreachs don’t go so nicely together because PGFPlots doesn’t process the plots firstly and then later draws them. (See PGFplots foreach equivalent to TikZ's with multiple variables separated by a slash for more information and explanations of the author of PGFPlot himself.) The package provides the macros ...

6

There are different ways of getting rid of that big empty space: Decrease the overall width of the plot, moving the groups of bars closer together. You can do this by specifying a unit vector for the x axis. If you add more data, the plot will grow automatically. Keep the overall width of the plot, but move the groups of bars closer together. You can do ...

5

This is where xticklabel cs comes in handy: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ylabel=$y$, zlabel=$z$, after end axis/.code={ \draw [-stealth, thick, red] (xticklabel cs:0.2) -- (xticklabel cs:0.8); ...

5

Since version 1.5.1 of PGFPlots, circle and ellipse radii are interpreted in terms of axis units (which is what you want). However, to maintain backwards compatibility, this feature isn't activated by default: you'll have to set \pgfplotsset{compat=1.5.1} (or higher). If you do that, you'll notice that you get an ellipse instead of a circle. That's because ...

5

This does look like a bug. As a workaround, you can set extra x tick style={ xticklabel={ \pgfmathparse{exp(\tick)} \pgfmathprintnumber[sci, precision=1]{\pgfmathresult} } } to print the correct label: \documentclass[11pt,titlepage,a4paper]{article} \usepackage{tikz,pgfplots,pgfplotstable} ...

4

You can adapt the approach from Adding values to pgfplot legend: \documentclass[11pt]{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents}{data.dat} 1 3 2 5 3 4 4 8 5 9 6 8 7 10 8 12 9 10 10 11 \end{filecontents} \begin{document} \begin{figure}[h!t] \centering \begin{tikzpicture} \begin{axis}[ ...

3

It seems like you need to set decoration={name=none} to disable the decoration in this context: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations,decorations.pathmorphing} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} \draw node[draw, decorate, decoration={random steps}] (box) at (0,0) { ...

3

There is a way to determine the radius in terms of the coordinates. Here is how. Assign a name to the points of interests. See \path (axis cs:x,y) coordinate (name); Assign them to commands \p1, \p2 and use veclen to determine the length of radius. calc from tikzlibrary is required Code \documentclass{article} \usepackage{amsmath} ...

3

You can enter the coordinate system (cs) of an axis using axis cs. You should use this, whenever you want to add something to a plot, because pgfplots takes care of appropriate data scaling, logarithms, and even symbolic x coords. Have a look at the following, this might give you a good starting point. \documentclass{standalone} ...

2

I use option {axis}[nodes near coords, x tick label style={rotate=45,anchor=east},] , maybe you could try in your favor. nodes near coords add the value for every bars. x tick label style={rotate=45,anchor=east}, rotate your label with angle 45. For the bar too wide, I think bar width=12pt is enough.

2

Here's an answer using Asymptote: The code: \documentclass[margin=10pt]{standalone} \usepackage{asymptote} \begin{document} \begin{asy} settings.render=4; settings.prc=false; size3(8cm); defaultpen(fontsize(10pt)); import graph3; currentprojection=orthographic(5,2,3); real ymax = 3; real ymin = -ymax; real h(real y) { return sqrt(1 + (y/2)^2); } ...

2

Specifying domain does not set the xmin, xmax etc. for the plot. It simply sets the function evaluation domain and then afterwards the min/max limits are set from the data. Due to rounding errors you can expect to see the behaviour you have. In general: Anytime you use groupplots and sharing axis domains you should specify x/ymin AND x/ymax. So your ...

2

You can use the draw position=<val> option to specify the location on x-axis. Code \documentclass[12pt]{article} \usepackage{pgfplots} % \pgfplotsset{compat=1.9} \usepgfplotslibrary{statistics} \begin{document} \begin{tikzpicture} \begin{axis}[ boxplot/draw direction=y, % xtick={1,2,3}, % xticklabels={1,2,5}, ] ...

1

And here is how to put a non-pgfplots style legend into pgfplots. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[xmin=0,xmax=10,ymin=-5,ymax=5,name=border] \end{axis} \node[below left=1mm] at (border.north east) {\fbox{ \begin{tabular}{@{}r@{ }l@{}} \raisebox{2pt}{\tikz{\draw[black] (0,0) -- ...

1

You can disable the decoration locally by setting decoration={name=none}: \documentclass[ a4paper ]{scrartcl} \usepackage{ tikz, pgfplots, amsmath } \usepackage[T1]{fontenc} \usepackage{ lmodern, textcomp } \usetikzlibrary{calc,trees,shadows,positioning,arrows,chains,shapes.geometric,% decorations.pathreplacing,decorations.pathmorphing,shapes,% ...

1

Perhaps this approach is somewhat useful for you. The axes are put at the left and bottom and there is a minor grid for the y ticks. There are no symbolic x coords anymore and instead you now have explicit xticklabels. The double first and last ticks are gone. The chemical compounds in the ticks of the abscissa have been formatted by »chemformula« from the ...

1

As selwyndd21 advised, I applied the suggestions of this question and the tiks are now clearly visible: \documentclass[11pt, oneside]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother \pgfplotsset{axis line on top/.style={ axis line style=transparent, ...

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