diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex index cb55235b94d..1eccd01e5c9 100644 --- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex +++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex @@ -161,9 +161,9 @@ The style is defined as follows. /pgf/bar shift={% % total width = n*w + (n-1)*skip % i.e. subtract half for centering - -0.5*(\numplots*\pgfplotbarwidth + (\numplots-1)*#1) + + -0.5*(\numplotsofactualtype*\pgfplotbarwidth + (\numplotsofactualtype-1)*#1) + % the '0.5*w' is for centering - (.5+\plotnum)*\pgfplotbarwidth + \plotnum*#1% + (.5+\plotnumofactualtype)*\pgfplotbarwidth + \plotnumofactualtype*#1% }, }, } @@ -207,11 +207,16 @@ The formular for |bar shift| assigns shifts dependent on the total number of plo \addplot coordinates {(1930,15e6) (1940,12e6) (1950,13e6) (1960,25e6) (1970,35e6)}; -\legend{Far,Near,Here} + +\addplot[red,sharp plot,update limits=false] + coordinates {(1910,4.3e7) (1990,4.3e7)} + node[above] at (axis cs:1950,4.3e7) {Houses}; + +\legend{Far,Near,Here,Annot} \end{axis} \end{tikzpicture} \end{codeexample} -Here |ybar| yields |/pgfplots/ybar| because it is an argument to the axis, not to a single plot. +Here |ybar| yields |/pgfplots/ybar| because it is an argument to the axis, not to a single plot. The style affects the first three |\addplot| commands. Note that it shifts them horizontally around the plot coordinates. The fourth |\addplot| command is some kind of annotation which doesn't |update limits|. As for |xbar|, the bar width and shift can be configured with |bar width| and |bar shift|. However, the bar shift is better provided as argument to |/pgfplots/ybar| since this style will overwrite the bar shift. Thus, prefer |/pgfplots/ybar=4pt| to set the bar shift. |