# Tag Info

7

Hopefully this will work with \input too. You can use a node to put your .tikz files \documentclass{article} \usepackage{graphicx,array,booktabs,tikz} \usetikzlibrary{calc} \begin{document} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} \begin{table}[htb!] \centering \begin{tabular}{P{5.5cm} P{5.5cm}} \toprule R220expt21 & ...

7

For a single plot, you can use the option update limits=false. For several plots, you can wrap them in the environment pgfplotsinterruptdatabb. In both cases, the result is the same: the given plots do not contribute to the computation of the bounding box. \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} ...

7

This can be done by the fillbetween library which is shipped with pgfplots version 1.10: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} % \usetikzlibrary{} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture} \begin{axis}[axis on top,set layers] \addplot[blue,name path=A,domain=0:2.3] ...

6

Use xticklabels={0, 1, 2, 3, 4+},: \documentclass[12pt,tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} %If you do not like this style just delete it. %But you will need to add to \addplot[color] this "line width=2pt, rounded corners" to change line width and add rounded corners. \tikzset{ every ...

5

Version 1.10 of pgfplots has been released just recently, and it comes with a new solution for the problem to fill the area between plots. Note that the old solution is still possible and still valid; this here is merely an update which might simplify the task. In order to keep the knowledge base of this site up-to-date, I present a solution based on the ...

5

I can not say, what the best way is to do it, from a design point of view. -but I can show what I did in a similar case. -using colors and marks. \documentclass{standalone} \usepackage{siunitx} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{semilogxaxis} [ width=\figwidth, height=0.75*\figwidth, ...

5

You can just treat the required 2d plot as a 3d plot with z=0. So using \addplot3 ({sin(deg(x))},{cos(deg(x))},0)` you get: Code: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ axis equal, view={45}{30}, compat=1.8, ...

4

Just use every axis y label/.style for that axis. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ every axis y label/.style={at={(-0.1,0.5)},rotate=90}, width=6cm } \setlength\parindent{0pt} \begin{document} \begin{tikzpicture} \begin{axis}[ylabel=thing] \addplot {x^2}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[% ...

4

Since, from the question, only the \cdot for the multiplier of the y-axis must bechanged, you can use ytick scale label code/.code={$\times 10^{#1}$}, (the only change from the default definition is that \cdot was replaced by \times). If the \cdot of both axis multiplier is to be changed, you can change the definition of tick scale binop instead, using ...

4

Another alternative is the use of scope environment via \clip command. \begin{scope}[yshift=-\pgflinewidth] \clip (axis cs:1,0) rectangle (axis cs:2,0.24); \addplot [draw=none,fill=blue] {gauss(x, 3, 1)}; \end{scope} Code \documentclass[border=2cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} ...

4

A PSTricks solution: \documentclass{article} \usepackage{pst-func} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n \ExplSyntaxOff % function \def\Gauss[#1,#2]#3{\calc{1/(sqrt(2*pi)*#2)*exp(-(#3-#1)^2/(2*#2^2))}} % settings \psset{xunit = 2, yunit = 5} % parameters \def\mue{2.5} \def\sigma{0.4} \def\pointA{1.5} \def\pointB{2.2} ...

4

The option legend image post style is precisely what you need: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \pgfplotscreateplotcyclelist{mycyclelist}{ {loosely dashed, blue}, {red} } \begin{document} \begin{tikzpicture} \begin{axis}[ cycle list name = mycyclelist, legend entries={a, b}, ...

4

Pgfplots has a tick scale binop option for this: It is located under the /pgfplots path, hence: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[/pgfplots/tick scale binop=\times] \begin{axis} [xmin=0, xmax=10000, ymin=0, ymax=10000] \addplot plot coordinates {(5000, 5000)}; \end{axis} ...

4

See How can I add a zero line to a plot? Find the inverse of the function, plug in the value. \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.9} \pgfmathsetmacro\result{-ln(1-0.63)*5} \begin{document} \begin{tikzpicture} \begin{axis}[ ymax = 1.15, ymin = 0, xmin = 0, xmax = 20, ytick = {0, .63, ...

4

One option: the inset is saved in a box and then placed at the desired position using a \node and the axis coordinate system for the main plot (See Section 4.17.1 Accessing Axis Coordinates in Graphical Elements): \documentclass{article} \usepackage{pgfplots} \newsavebox\mybox \begin{document} % the box is filled with the inset \savebox\mybox{% ...

3

Another alternative is use of the clip twice, without fillbetween library. First, fill the area below sine curve and then clean the area above cosine curve. Code: \documentclass{article} \usepackage[papersize={11cm,10cm}]{geometry} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \thispagestyle{empty} \begin{document} \begin{tikzpicture} ...

3

In my documents, I usually have the following in the preamble: \pgfplotsset{every axis/.append style={ line width=.6pt, tick style={line width=0.6pt,black}, grid style={line width=0.6pt,dotted,gray}}} If I now just write \begin{axis}[% grid style={line width=6pt,dotted,gray},...] within a figure this will overwrite the predefined setting.

2

You can always define styles. There are lots of styles available, among them every axis post : allows to override all options after \begin{axis} set in your .tikz file every tikzpicture : allows to define default options for every tikz picture. Useful keys could be trim axis left, trim axis right, and baseline. Please refer to Section "Alignment Options" ...

2

Would this be what you want? To plot a stacked ybar, replace ybar by ybar stacked and add more addplot commands with y=stationary replaced, etc etc. Also remove ymax=210 or reset it. Or in a cleaner way automatically as shown in the second plot. \foreach \i in {Electricity,Stationary,Transport,Fugitive,Industrial,Agriculture,Waste}{% \addplot table [x ...

2

What you need is possible with a style set up which configures the non-linear transformation for the rain axis computes suitable (coupled) axis limits for both y axes computes suitable (coupled) units for both y axes requires manual input to decide where both axes start/end. From what I understand from your use-case, this input consists of the the min ...

2

Thanks alfC, with your help and a little further research I was able to achieve a solution I am pretty ok with: \documentclass{scrreprt} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel} \usepackage{pgfplots} ...

2

There are several possible interpretations of your question. The first is that you want to draw a surface representing the "outer shell" (convex hull? interpolation by a smooth surface?) of some data points given in no particular order. Mathematical algorithms for producing such surfaces virtually always produce triangulated surfaces. Since you insist on a ...

2

The problem with "Dimension too large" is a weakness in pgfplots: it has to map all coordinates into TeX's limited number range eventually, and it fails to detect that it cannot do so without discarding coordinates. In your case, the input range of the y coordinates is much greater than the actually displayed portion. I'd suggest to add restrict y to ...

2

You are absolutely right @Johannes_B, something so small can produce so many problems when someone has never used tikz. Thank you all for your time and effort. I will also post the updated version just in case that someone might occur the same error as me. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows,automata} ...

2

You are testing if number (##1) is negative or not. When it's negative convert it to positive with -##1. \documentclass{article} \usepackage[table]{xcolor} \usepackage{pgfplotstable} \pgfplotstableset{ color cells/.style={ col sep=comma, string type, postproc cell content/.code={% \pgfkeysalso{@cell ...

2

Use \closedcycle for addplot: \documentclass{article} \usepackage{pgfplotstable} \begin{document} \begin{figure}[!h] \centering \begin{tikzpicture} \begin{axis}[enlargelimits=0.1] \addplot[domain=-.15:1,fill=gray!50] {x^2}\closedcycle; \addplot [thick,color=blue,mark=o,fill=blue, fill opacity=0.05]coordinates { ...

1

Another approach is to clip and fill the plot twice. The first scope clips and fills (in blue) triangle containing the two curves, then the second scope clips and fills (in white) the area above x^2, yielding Code \documentclass{article} \usepackage[papersize={12cm,10cm}]{geometry} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \thispagestyle{empty} ...

1

Two more options: 1.- Divide your plot for x^2 in two plots, one without fill option and domain=-0.15:0 and a second one with fill option and domain=0:1. \begin{tikzpicture} \begin{axis}[enlargelimits=0.1] \addplot[domain=-.15:0]{x^2}; \addplot[domain=-0:1,fill=gray!50] {x^2}\closedcycle; \addplot [thick,color=blue,mark=o,fill=blue, ...

1

You can use the feature of adding extra ticks. Include the key extra y ticks={<ymin>, <ymax>} where you can manually write the values <ymin> and <ymax> to the axis environment. You can also use extra y ticks={\pgfkeysvalueof{/pgfplots/ymin}, \pgfkeysvalueof{/pgfplots/ymax}} since you have already explicitly specified the limits ymin ...

1

You could reduce the size of each axis and place it along with the \caption in a minipage, and then place all four minipages in the same figure. With all the axis labels it may become a bit cramped though, so I'll suggest another way, using groupplots. To make the bars vertical you need to switch from xbar to ybar, and also switch all x<things> to ...

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