Articles of pgfplots

Removing x-labels and confusion

I’m quite new to LaTeX. I’m trying to figure out how to get rid of the x-value labels altogether (because I have the key). \begin{tikzpicture} \begin{axis}[ width = 0.85*\textwidth, height = 8cm, major x tick style = transparent, ybar=2*\pgflinewidth, xticklabels=\empty, bar width=14pt, ymajorgrids = true, ylabel = {Percentage}, xlabel = {}, symbolic x coords={Doramus,Refaltido,Misanit,Fanatha,Sonphay,Laoli,Tidanme}, scaled […]

Graphing trigonometric functions, axes labeled with tick marks

I am providing the code for graphing three trigonometric functions. (In the preamble, I had to put a % before the command \usetikzlibrary{calc,angles,quotes} because LaTeX could not compile it with the command. It gave me the error can’t find file ‘tikzlibraryangles.code.tex’. MikTeX2.9 is compiling the code.) How do I add the labels “$\scriptstyle{y = \sin(x)},” […]

How to remove the white spaces in the margin of pgfplots?

I have the following code from pgfplots‘s web site. I execute it but I get a full pdf file as shown below: However, I would like to reproduce the figure as given here http://pgfplots.sourceforge.net/example_8.pdf. How can I do it? \documentclass{article} % translate with >> pdflatex -shell-escape <file> % This file is an extract of the […]

Use just a specific range of a colormap or shading in tikz

I’d like to create an image with tikz that uses just a part of a predefined colormap or shading. More precisley, if I have e.g. the jet-colormap I like to create several rectangles that use the jet colormap, but not the full range but rather some part: I tried different approaches with a colormap, e.g. […]

Calculation of coordinates for TikZ annotations in PGFplots axis environment

I’m trying to do some annotation with TikZ in a PGFplots axis environment by means of nodes. However, the placement of the nodes is going wrong all the time, see the minimum working example below. How can I fix this? How do I calculate the coordinates for the TikZ annotation properly? MWE: \documentclass[margin=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} […]

Plot function with 2 variables in tikz / pgfplots

Using Tikz / pgfplots, how can you plot a function with two variables, such as: |x| + |y| <= 1 / sqrt(2)? If the function only had one input,X, it is easy to plot: \begin{figure}[!hb] \centering \begin{tikzpicture}[scale=1.0] \begin{axis} \addplot[domain=-10000:10000, blue, ultra thick] {abs(x)}; \end{axis} \end{tikzpicture} \caption{Plot of $\abs(x)$} \end{figure} However, the following produces an error […]

How to make latex parse `x` as an argument of a macro definition instead of `#1`

When I define a mathematical function for plotting in pgfplots or pstricks I usually to it in the following way: \def\f(#1){(#1)^3 + 3*exp(#1)} just as suggested by Jake in his answer to a question about how to define a function consistently for plotting and computations in pgfplots with and without gnuplot. However is it possible […]

pgfplots + animate: complicated line-by-line animation

I want a retangle with 80 diagonal lines: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ %———————— %% Options %———————— width= 100mm, %height = 50mm, xmax=70, xmin=0, ymax=50, ymin=0, axis x line=bottom, axis y line=left, enlargelimits ] %———————— %% Define Clipping %———————— \pgfplotsextra{% \clip (axis cs:0,0) rectangle (axis cs:60,40); % http://www.latex-community.org/forum/viewtopic.php?f=45&t=22837&start=0 } %———————— %% Loop %———————— \foreach […]

density wave with pgfplots

For a presentation on the human hearing I need to create a sketchy diagram representing the behaviour of the air particles when they are passed through by a pressure wave. Something like this: Can I make such a diagram with PGFPlots? It allows to draw a randomly distributed marks across a rectangular, but I haven’t […]

Area between curves

I want to fill the area of a region R bounded by x=f(y), x=g(y), y=A and y=B. For example, R is bounded by x=0, x=2/y, y=1 and y=4.