Hot answers tagged

6

Add xticklabel style={rotate=90} to the axis options. Example: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} \begin{tikzpicture} \begin{axis}[ xticklabel style={rotate=90}, date coordinates in=x, xticklabel={\day.\month.\year} ] \addplot coordinates{(2015-01-05,42)(2015-06-20,24)}; \end{axis} ...


4

Here are a few possible solutions: 1. Use pdfLaTeX The fonts come out correctly if you compile your MWE using pdfLaTeX. 2. Use fontspec with LuaLaTeX or XeLaTeX LuaLaTeX and XeLaTeX will allow you to use fontspec to load any .ttf or .otf font in your system's font folder or your TeX distribution.* Here, I have used fontspec to load Palatino Linotype (a ...


4

Try to use different names for each couple of coordinates: spypoint1 and magnifyglass1, then spypoint2 and magnifyglass2, etc. Result: \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \usepgfplotslibrary{groupplots} \usetikzlibrary{spy} \begin{document} \begin{tikzpicture}[spy using outlines={circle, ...


4

One option is a groupplot, another is a combination of the name and at keys to position the first axis relative to the second. \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \begin{document} An example with the \texttt{groupplots} library: \begin{tikzpicture} \begin{groupplot}[ group style={ group size=2 by 1, y ...


3

Add no markers, every axis plot/.append style={ultra thick} to the axis options. I don't have your data files, so in the example below I've used random numbers. Instead of ultra thick you can use any of the other default styles defined by TikZ (semithick, thick and very thick), or set the width explicitly using e.g. line width=4pt. (4pt is likely ...


3

You have to use the tick label style inside extra y tick style. Add hide obscured x ticks=false and hide obscured y ticks=false to get the zeros printed. If this options are true (that is default) ticks will be hidden if the could be behind other axis lines. Code: \RequirePackage[svgnames,dvipsnames]{xcolor} \documentclass[tikz]{standalone} ...


3

You can use the option smooth: \documentclass{standalone} \usepackage{xcolor} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ scale=0.8, axis lines=middle, grid=major, xmin=-5, xmax=5, ymin=-5, ymax=5, xlabel=$x$, ylabel=$y$, xtick={-4,-3,...,5}, ytick={-4,-3,...,4}, tick style={very thick}, smooth ] \addplot[domain=-6:6, blue, ...


3

table[y expr=\thisrowno{1}^2,...]


3

Crude quick hack: \def\cdot{\times} Or without disabling \cdot: I have not found a configuration option. \cdot is hardcoded in the internal macro \pgfmathfloatrounddisplaystyle@std, which is assigned to \pgfmathfloatrounddisplaystyle. The following example file redefines these macros to use \times instead of \cdot. Also the y limit is enlarged a bit, ...


3

This artifact is visible whenever a non-boxed axis style is used. If a boxed plot is used, the axis box line covers this area, so the clipping is not visible. In addition to the proposed changes by corporal, you can avoid the clipping on a per-axis basis by adding clip=false to the axis options. Beware that this may be unsuitable for plotting certain ...


2

It is just as Jake commented. The * for multiplication was missing. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{semilogxaxis}[xlabel=Frequency, ylabel=Gain, xmin=1, xmax=20000, ymin=0, ymax=2] \addplot[domain=1:1e4,color=red] {((2*pi*x)^2 + 10^6)/(11*(2*pi*x)^2 + 10^6 + 10^4)}; % ...


2

I find easier the macros in the tkz-fct package in order to plot graphs \documentclass{standalone} \usepackage{tkz-fct} \begin{document} \begin{tikzpicture} \tkzInit[xmin=-5,xmax=5,ymin=-5,ymax=5] \tkzGrid[color=gray!40,line width=0.2pt] \tkzDrawX[color=black,label={$x$},above left=5pt] \tkzLabelX[color=black] \tkzDrawY[color=black,label={$y$},below ...


2

Use the TeX Gyre fonts they are part of any TeX distribution. \documentclass[class=minimal,border=0pt]{standalone} \usepackage{amssymb} \usepackage{amsmath} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{calc} \tikzset{>=latex} \usepackage{pgfplots} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} \setsansfont{TeX Gyre Heros} ...


2

Adapting Stefan's code to Sigur's answer, a possible solution could be \documentclass{article} \usepackage{calc} \usepackage{ifthen} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colormaps} \tikzset{ mycolor/.style={ color of colormap={#1}, fill=.!30, } } \begin{document} \newcommand{\slice}[5]{ %% use 5 arguments ...


1

\begin{tikzpicture} \begin{axis}[xticklabel style={anchor=east,rotate=90}, date coordinates in=x, xticklabel={\day.\month.\year}, table/col sep = semicolon, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%INCLUDED LINES xtick=data, symbolic x coords={{01.10.2015}, {15.10.2015}, {01.11.2015}, {15.11.2015}, {01.12.2015}, ...


1

\begin{tikzpicture}[scale=1.0] \begin{axis}[ ymajorgrids=true]%THIS WILL DRAW THE HORIZONTAL LINES \addplot table [col sep=comma] {data.csv}; \end{axis} \end{tikzpicture}


1

You can use the smooth option in the \addplot +[...] options to smooth the curve. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot +[smooth] table [x=a, y=b] { a b 50 410 80 390 120 405 150 430 180 445 210 455 240 440 270 415 }; \end{axis} \end{tikzpicture} \end{document}


1

It is easier for people to help if you post a complete document, as below, that shows the problem rather than disconnected fragments, but anyway, it fits on the page if you reduce the font size, and steal a bit of the bottom margin. \documentclass[12pt]{book} \usepackage{lscape,longtable} \begin{document} \begin{landscape} \scriptsize ...


1

Here is a MWE: \documentclass[12pt]{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture} \begin{axis}[width=\textwidth, height=0.5*\textwidth, xlabel=$x$] \addplot+[id=parable,domain=0:20, samples=500, mark=none, width=2pt] gnuplot{besj0(x)} node[pin=95:{$J_0(x)$}]{}; \addplot+[id=parable,domain=0:20, ...



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