Tag Info

2

For plots, use pgfplots; its great customization capabilities allow to easily adapt the style to the one you want: The code: \documentclass[border=10pt, tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{arrows} \tikzset{ >=stealth', punkt/.style={ rectangle, rounded corners, draw=black, very thick, ...

1

So i kind of solved the problem with some help form the pgfplots manual pages 470-2, and this other question. I have this in my preamble: \usepackage{tikz,pgfplots,pgfplotstable} \pgfplotsset{compat=1.9} %\usetikzlibrary{external} \usepgfplotslibrary{external} \tikzexternalize \tikzset{external/system call={lualatex -shell-escape -halt-on-error -interact ...

1

Here is a solution with pstricks in answer to a similar quesion: \documentclass[x11names]{standalone}% \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \pagestyle{empty} \usepackage{pstricks-add, pst-3dplot} \usepackage{auto-pst-pdf} \def\localbasis{\psline{<->}(1,0)(0,0)(0,1)} \def\\M{6*\pstPI1} \begin{document} \footnotesize \psset{xPlotpoints ...

2

Following the answer given by @LaRiFaRi, groupplots works for me (code at ShareLatex): \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{pgfplots.groupplots} \pgfplotsset{compat=1.3} \begin{document} \begin{tikzpicture} \pgfplotsset{footnotesize,samples=10} \begin{groupplot}[group style = {group size = 3 by 1, horizontal sep = ...

3

A circle will appear a circle independent of the axis used since it is't entered as data or a table of values. The problem with your code is merely of specifying the unit of length of the radius. Is it 1pt, 1in, 1cm? you should specify. Here is what I get if I specify 1cm, for example: \documentclass[tikz,10pt]{standalone} \usepackage[utf8]{inputenc} ...

1

Fill, then draw: \documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture}[scale=0.5] \fill[green] (0,15) to [out=0,in=90] (15,0) to [out=90,in=180] (30,15) to [out=180,in=270] (15,30) to [out=270,in=0] (0,15); \draw[very thick,name path=A] (0,15) to [out=0,in=270] (15,30); \draw[very ...

4

See the answers here: Change color of plots in pgfplots globally You can set the style globally using pgfplotsset, in your case something like \pgfplotsset{every axis plot post/.append style={blue,mark=none}}. Example with blue curves and black axes: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{every axis plot post/.append ...

1

This seems to work. I removed the dateplot stuff, and instead of x=date for the \addplot, I used x expr=\coordindex. This uses the index of the coordinate instead, i.e. 0,1,2,..., which gives constant distance between ticks. xtick=data places the ticks at the right place. You do need to load pgfplotstable to use x expr=\coordindex. As a sidenote, ...

8

The problem is that you're not sampling the point at x=0, because the default domain runs form -5 to +5 and you're using an even number of samples. By setting samples=101 and/or setting domain=0:5, you'll at least get a connected plot. But the sampling isn't going to be dense enough where things are interesting (near x=0), so you'll still need to use a large ...

0

I have (finally) solved this with a LOT of assistance from Alenanno. Thank you! First, I render 360 frames in one file, then another .tex-file creates the animation. It works as perfect as I ever wanted it to. Now for the code(s): File 1 - Create graphics and frames The graphics are created here, where the variable is called \angle. I have created 360 ...

4

Before showing the results, some notes This answer will only cover your first graph. Reason being that the code for it is already long and it took a while. Also the first graph is incomplete. The blue and green arrows are missing, and I'm not sure if you wanted them to follow the intersection between the marker and the sin waves while being constrained in ...

1

You have to reverse the order of the plots to get the right curves at the legend entries. \addlegendentry adds a legend entry for each plot, plot after plot (so, in your example for the two dashed curves). I also added some code so that the code compiles... \documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} ...

2

You can format axis, and show a coordinate of your choice: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \begin{document} \begin{tikzpicture}[font=\tiny] \begin{axis}[ axis x line = middle, axis y line = middle, axis z line = middle, view={150}{35}, domain ...

2

Percusse's comment provided the key word "oblique projection". Some googeling lead me to the following solution: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ x={(-0.3535cm,-0.3535cm)}, y={(1cm,0.0cm)}, z={(0cm,1cm)}, ...

9

You can place labels parallel to the plot lines by adding node [pos=0.6, sloped, anchor=south] {<Text>}; at the end of the \addplot lines: Note that I reduced the number of samples from 1000 to 30. For a function that's as smooth as this one, you don't need that many sample points. \documentclass[convert]{standalone} \usepackage{pgfplots} ...

3

You can use the restrict z to domain key. It can be applied for the entire axis or per-plot, whichever you require. \documentclass{standalone} \usepackage{tikz, pgfplots} \pgfplotsset{compat = 1.12} \begin{document} \begin{tikzpicture} \begin{axis}[xmin = -1.1, xmax = 1.1, ymin = -1.1, ymax = 1.1, zmin = -1.1, zmax = 1.1] ...

4

There are a couple of ways of solving this. One way is to move the ybar option from the \addplot to the axis. The same key means slightly different things in the two locations, in the axis it refers to /pgfplots/ybar, while in the \addplot it refers to /tikz/ybar. It would appear that these lead to different behaviours for the legends, though I have not ...

1

Here is a little example, using pgfplots package, you can check the following in the package documentation: Line styles p165, 4.7.2 Line Styles; Nodes p190, 4.9 Axis Description; \documentclass{memoir} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[a4paper]{geometry} \usepackage{pgfplots} \usepackage{vmargin} ...

0

As suggested by @LaRiFaRi the x tick labels can be defined programmatically using the Pgfplots key xticklabel. So adding the following option to the second axis does the trick: xticklabel={\axisdefaultticklabel\vphantom{$10^6$}} I have used the predefined command \axisdefaultticklabel which just prints the usual tick labels and added an extra space that ...

2

I don't know an automatic method to proceed this, i just modified the `xticklabels' option: here is the example:(manual method) \documentclass{memoir} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[a4paper]{geometry} \usepackage{pgfplots} \usepackage{vmargin} \setmarginsrb { 1.5in} % left margin ...

1

The answer is posted by OP in the question. \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \newcommand{\maxVal}[1]{ \pgfkeys{/pgf/fpu} \pgfmathsetmacro\buffer{0.0} \pgfplotstableforeachcolumnelement{#1}\of\dataExternalA\as\cellValue{\pgfmathsetmacro{\buffer}{max(\buffer,\cellValue)}} } ...

3

You mean something like this: Above picture is obtained by: \documentclass[border=3mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ title=Title, width=7.8cm, enlargelimits=0.15, legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1}, ylabel={Pages}, bar width=7mm, ...

2

You can use every axis plot/.append style={fill,draw=none,no markers} as an option of the axis environment. Code: \documentclass[margin=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, width=12cm, height=3.5cm, enlarge y limits=0.5, xlabel={Value}, ...

1

Something like this: It is obtained by: \documentclass[border=3mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, width=12cm, height=3.5cm, enlarge y limits=0.5, xlabel={Value}, symbolic y coords={Instance1,Instance2}, ytick=data, nodes near coords, nodes near ...

2

With 20 samples in each direction the sample points in the interval from -1 to 1 miss the value 0. Changing to 21 samples gives It is perhaps easiest to think about the case of 2 samples, these are -1 and 1 vs. 3 samples, which are -1,0 and 1. In the 20 sample case, first sample is -1 and the other are spaced 2/19 apart, so the list of values is -1, ...

1

I don't completely understand what you want to achieve, but to answer your questions: 1) Use \pgfplotsset{every x tick label/.append style={font=\scriptsize}} instead. 2) You could put the y-axis ticks for the second and third plot on the right side instead and remove/decrease the horizontal separation of the plots. Use axis y line*=right in the options ...

4

You need to add clip=false to the axis options, by default anything drawn outside the axis limits are clipped away. \documentclass{beamer} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{positioning,fit} \begin{document} \begin{frame} \frametitle{TEST} \centering \begin{tikzpicture} ...

4

Vertical line Time out could be interpreted as infinite value for the vertical time axis, visualized by a vertical line to make clear that the next thread is never reached. \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{semilogyaxis}[ xlabel=Number of threads, ylabel=Simulation time in s, legend ...

2

A bit crude, but you could draw the axis lines manually, with execute at end axis={ \draw [-stealth] (axis cs:-3.5,0) -- (axis cs:3.5,0); \draw [-stealth] (axis cs:0,-3.5) -- (axis cs:0,3.5); } Requires clip mode=individual as well, and axis line style={draw=none} to turn off drawing the 'real' axis. You can of course wrap all the ...

2

I'm not sure if this is anything like what you had in mind, but if you add another data point, set the ymax to a smaller value than the y-value for this new data point, and finally add clip=false, you get plot lines extending out of the axis. \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{semilogyaxis}[ ...

1

One solution is to determine xticklabel style where you add yshit=-2pt, i.e.: ... \subfloat[Linear horizontal axis]{ \begin{tikzpicture} \begin{axis}[ ytick pos=right, width=5cm, height=5cm, xticklabel style={yshift=-2pt},% <--- add in second subfigure ] \addplot table[row sep=crcr]{% 1 1\\ 10 2\\ }; ...

2

Option scatter/use mapped color can be used to change the draw color of the marks to the same as the fill color. (The value none did not work.) The line width of ultra thick is 1.6 pt. The default draw line width is 0.4 pt. The the value of the size (radius) of the mark should be set to (1.6 pt - 2 * 0.4 pt/2)/2 = 0.6 pt. \documentclass{article} ...

3

You are nesting identical style keys: xticklabel style and x tick label style are the abbreviations for the same key every x tick label/.style for compatibility reasons. Remove the inner or the outer to have the effect. Edit: to clarify discussion in comments I add the complete MWe with some explanation: \documentclass{amsart} \usepackage{pgfplots} ...

1

Using the calc library you can say ( $(A)!<length>!(B)$ ) to locate the point that is <length> units from (A) on the segment joining (A) and (B). For example \node at ( $(axis cs:90,90)!7.5pt!(axis cs:100,100)$ ) {$\ell$}; will place $ell$ at a distance 7.5pt away from (axis cs:90,90) along the segment joining (axis cs:90,90) and (axis ...

2

The reason why you can't read the file is because the command \ST043-2 is not parsed correctly. My guess is that the hyphen - breaks the command. If I replace all instances of \ST043-2 with \stear as in the code below, it compiles fine. (I also deleted the color names because it wouldn't compile for me with the color names.) \documentclass{article} ...

2

You can basically do everything as you go along the path with naming coordinates and continuing by referring to those. There is no need for intersections for this example. \documentclass{standalone} \usetikzlibrary{calc} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[width=5in,clip=false,axis equal ...

5

The root cause is a deficiency in the TeX based floating point unit employed by pgfplots. An intermediate result requires to compute \begingroup %\tracingmacros=2 \tracingcommands=2 \pgfkeys{/pgf/fpu} \pgfmathparse{exp(-3.4814e4)}\pgfmathresult \endgroup which reaches some internal limit. I accept that as bug report and will see if I can fix it. For the ...

3

Two ways: first, definig a function and plotting each piece separately, as was suggested in What is the clearest way to graph a piecewise function?; second , using two plots (the first approach might seem an overkill here): \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[ declare function={ func(\x) = (\x<0.5) * ...

1

I would suggest that you actually use PGFPlots, since you're already including it. Are you trying to do something like this? \documentclass[tikz]{standalone} \usepackage{pgfplots} %why are you not using at least compat=1.3? \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture}[scale=10] \begin{axis}[ xmin=0, ...

3

I haven't done the surgery for which exact reason it hangs but the culprit is using \mathchars in the the header of the table. A very rough explanation is that pgfplots' internal naming mechanism uses the header entry of the column as the internal column name macro. So let's say mycolumn is the header entry and with a sophisticated naming scheme, internally ...

4

Well, you have added enlargelimits to the options, which extends the axes lines beyond the defined limits, so that behaviour is as you would expect. As you yourself mentioned in a comment, shorten >=-0.1cm,shorten <=-0.1cm in axis line style also helps extend the axis lines. To remove all ticklabels, just add xticklabels={},yticklabels={}. Your ...

1

You should define the point outside of all axes to be independent of the axis used. Since (c) is a coordinate, you can simply define it by \def\Pointc{0.6,0.8}. \documentclass{standalone} \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest} \begin{document} \def\Pointc{0.6,0.8} \begin{tikzpicture}[x=0, y=0] \begin{axis}[ xmin=0, xmax=1, ymin=0, ...

5

Simplest way is to just define a macro for the coordinate and reuse it: Code: \documentclass{standalone} \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest} \newcommand*{\SpecialPoint}{0.6,0.8} \begin{document} \begin{tikzpicture}[x=0, y=0] \begin{axis}[ xmin=0, xmax=1, ymin=0, ymax=1 ] \node [circle,inner sep=2pt,fill=white,draw] at ...

2

Edited Version: Inserts Axes Ticks The positioning of the ticks' label is a little "brittle": you could have ugly results depending on the values you set in the \tdplotsetmaincoords macro. Moreover, the code gets more and more complicated, so for even more complex figures it could be better to use pgfplots. \documentclass[border=5pt]{standalone} ...

2

This is how to do it using manual alignment. \documentclass[border=.1in]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ylabel=y, extra description/.code={\node[below left,inner sep=0pt] at (-1cm,0) {a)};}] \addplot coordinates {(0,0) (5,5)}; \end{axis} \end{tikzpicture} \end{document}

2

You almost had it: use patch instead of surf. Both are the same, but the input format differs: patch accepts individual patch segments (triangles per default) whereas surf expects a matrix on input. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[ grid=major] \addplot3[ ...

3

You have several options here: Use a white plot (this option I don't like much since the plot is still drawn but in white color): \addplot[white,domain=-10:16,name path=perpendicular_line] {-x + 15}; Use a \path with the plot TikZ syntax which is not drawn: \path[name path=perpendicular_line] plot[domain=0:15] (\x,-\x + 15); Add draw=none to the plot ...

1

I do not know why that syntax doesn't work, but you can use the syntax of the calc library. While not exactly the same, it does allow you to place axes relative to other nodes/coordinates. Note that the default anchor for the axis is south west, change that if desirable. In the code below I used at={($(nodeOne)+(0cm,1.5cm)$)}. When no anchor for the node is ...

1

Here is a suggestion. I use a second groupplot environment for the third axis, and place it relative to the second axis. For the ylabel I simply used shift to move it down a bit. For the third axis, note that the height is set explicitly for each of the groupplots, so that their combined height is the same as the other axes (4cm). ...

2

You have to use \addplot3[surf] table [col sep=comma] {dat.csv}; to tell PGFPlots to expect commas as column separators. By default, PGFPlots assumes that the columns are separated by white space.

Top 50 recent answers are included