{pgfplots} is a package for creating 2D and 3D plots of mathematical functions and numerical data, using the PGF graphics framework. For questions about the inbuilt plotting functionality of TikZ/PGF, use {tikz-pgf} instead.

learn more… | top users | synonyms

4
votes
1answer
21 views

Calculate axis limits depending on depicted data

In a pgfplots axis environment, I want to make the axis limits dependent on the depicted data or some other data. Consider the minimum working example \documentclass{standalone} ...
2
votes
0answers
29 views

pgfplots complains path is empty

I'm trying to fill an area under a curve drew with pgfplots. I've tried the solution outlined in this answer: \documentclass{article} \usepackage{amsmath} \usepackage[usenames,dvipsnames]{xcolor} ...
7
votes
2answers
121 views

Draw a smooth surface

I would like to draw a smooth surface like http://mathematica.stackexchange.com/questions/20912/how-to-draw-a-higher-genus-surface but using Asymptote, TikZ, Metapost, PStricks, or other TeX friendly ...
3
votes
1answer
47 views

Invert axis using pgfplots and TiKz

I am trying to do a stacked histogram, and I am trying to start from the code provided in this question : Tikz Stacked Bar Chart with Text Yet, I would like to invert the axis, so that the A,B,C... ...
3
votes
1answer
25 views

Changing the properties of only one plot in a ybar

Sorry I am sure there is a simple answer to this but I just can't find it! All I am trying to do is turn off the labels (I think they are called nodes near coords) on the second set of data, ie. the ...
1
vote
0answers
35 views

Memory overload due to pgfplots / tikz

first of all, I need to mention that there are 2 related threads, that I found usefull: 1, 2. I am working with TeXstudio 2.8.8 on Win 7 64bit (i5 @3.3GHz, 8GB RAM - if this matters). My goal is to ...
3
votes
1answer
38 views

Nodes Near coords hide when 0

Is it possible to hide nodes near coords in pgfplots when value = 0 ? I have something like this. And axis setting \begin{axis}[ ybar, bar width=3pt, nodes near coords ]
1
vote
0answers
21 views

pgfplots(table) protect ##1 when in a `\newcommand` with optional arguments

I am using the excellent answer from @percusse to the question How to rotate head row cell entries of pgfplotstable which works great if you always want rotated headers. I am calling ...
2
votes
1answer
26 views

Log mode of short X-axis pfgplots

I'm trying to obtain this graph (made in Origin): Both axes in log scale. This is MWE: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{units} \begin{document} ...
3
votes
1answer
38 views

How to calculate “extra y ticks” value by function instead of giving a fixed value

The code is as follows: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \begin{document} \tikzset{ declare function={ func(\x)= \x*\x; } } \begin{tikzpicture} \def ...
2
votes
1answer
22 views

Fill between on top of axis background

How can I draw the fill between area on top of another fill area that is drawn in the axis background preaction? MWE: \documentclass{article} \usepackage{pgfplots, pgfplotstable} ...
3
votes
3answers
88 views

Sizing a pgfplot so it fits in a multicol column

I'm very new to TeX but I'm trying to put together a document that has a multicol layout with a chart inline in the column. The chart always seems to overflow the width of the column and I can't ...
1
vote
0answers
43 views

Conflict tikzscale and matrix group plot

I want two axis environments next to each other in one figure environment. I want them to be vertically aligned and scaled to the width of the text. I am trying to achieve this by means of the ...
2
votes
1answer
191 views

Plotting f(x) = sin x and f(x) = cos x on pgf/tikz

I'm new to graphing on TikZ/pgf and have been trying to figure this out but can't seem to find any helpful info for what I want. I want to plot the above functions over one period, i.e. on the ...
0
votes
1answer
35 views

two tables of same size tikz

I am creating two tables with the following code (tikz package} \documentclass[twoside,11pt]{article} \usepackage{tikz} \usepackage{url} \usepackage[T1]{fontenc} \usetikzlibrary{positioning} ...
7
votes
1answer
370 views

Common label for a groupplot

This can be considered a combination of the following questions How can a title be placed for a group of pgfplots? Align ylabels of grouped plots at a common line The following piece of code ...
2
votes
1answer
37 views

Problem with legend on a 2 y-axis line & ybar figure

I cannot seem to figure out a way to switch the legend symbol to the ybar symbol in a two y-axis plot. Here is a minimal working example of my problem Which yields this: So the only problem with ...
0
votes
0answers
49 views

Tikz scientific notation vs. decimal number on x and y axis

I found an interesting potential glitch in tikzpicture in that the arbitrary placement of scaled ticks = false, tick label style ={/pgf/number format/fixed} within the \begin{axis}[] makes a real ...
5
votes
3answers
181 views

Specifying some points in rectangular coordinates and other points in polar coordinates

I would like to draw a right triangle inscribed in a circle on the Cartesian plane. In the following code, a circle of radius 3 and center (1,1) is drawn. One side of the triangle, the hypotenuse, is ...
1
vote
0answers
44 views

Pgfplots: Placing legends individually to the end of lines

I have a few days of experience with LaTeX. It seems almost everything is possible if you just find out how. So, here is a challenge... If a plot has many lines it is much more readable to have ...
4
votes
2answers
137 views

High degree polynomial plotting with Tikz/pgfplot

I am new to tikz/pgfplots...so sorry if my question has been asked... I am trying to plot the tanh function using pgplots, then add a set of N points and plot the (n-1) degree polynomial passing ...
4
votes
1answer
196 views

Best program for 3D plotting for LaTeX

I'm cross-posting this (also on Mathematics stack exchange, but not really getting the answers I'm looking for, so thinking I may have posted in the wrong community originally). I've hit a roadblock ...
2
votes
0answers
57 views

Comparison of the plots of the same line on the Cartesian plane using pgfplots and TikZ

I have the plot of a line using pgfplots and the plot of the same line using TikZ. I would like them to be identical. I need to correct a mistake in the plot of a line using pgfplots. The point ...
3
votes
1answer
266 views

pgfplotsforeachungrouped in groupplot

I want to create a grid of plots with groupplots, where every plot is taken from an external file and included via pgfplots. Due to the fact, that foreach doesn't work nicely in a axis environment, ...
6
votes
2answers
52 views

How to draw line through group plots in pgfplots?

This issue has been driving me crazy for the past 10-20h. I have a group plot (pgfplots) where I have 2 plots one under another. I'd like to draw a vertical line (e.g. a helpline at x=150e-6) that ...
2
votes
0answers
25 views

Automatically positioning a legend relative to multiple plots in groupplots

This question deals with centered legend placement in a set of plots aligned with groupplots. However, as the OP stated in a comment, the (accepted) solution requires some hand tweaking. I suspect ...
16
votes
2answers
779 views

XeLaTeX and TikZ - how do I ensure my PDFs are using the CMYK color model?

The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in TikZ or pgfplots. As suggested in this ...
3
votes
2answers
52 views

row index of first non-zero element in pgfplotstable

I am using the "functions" \findmin and findmax from here quite much to dynamical format and set plots from CSV data I read in. In the same vein, I want a function \findFirstNonZeroIndex, which ...
8
votes
1answer
76 views

Plotting several 2d curves (with different colors) in a 3d graph

I'm trying to reproduce 3D plots with several 2d curves, like in Plotting several 2D functions in a 3D graph. The end result looks like this: The questions are: I would like to change X labels ...
2
votes
1answer
99 views

Electromagnetic Wave Propagation with TikZ [closed]

I'm looking for a code drawing the below picture with TikZ if it is possible: I just need the graph in the middle, i.e. there is no need to also include the text and/or equations. Simply the plot ...
4
votes
2answers
80 views

Fill intersection between two parametric paths (e.g. circles) in pgfplots

I tried to use the fillbetween library of pgfplots to fill the intersection of two circles. However I get it with "inverted" colors: \documentclass{standalone} \usepackage{pgfplots} ...
2
votes
1answer
35 views

Why does pgfplots's “current plot style” throw an error even when it works?

I managed to produce the following diagram with pgfplots and TikZ: This is exactly how I want it to look. The following M(-ish)WE reproduces the diagram: \documentclass{article} ...
5
votes
0answers
58 views

Enlarge limits to nearest tick

I'm using pgfplots to auto-plot a number of datasets. The x-axis is in this case not to be enlarged. I'm using enlarge y limits, to get a clearer view of the data, but i would like it to scale to the ...
3
votes
1answer
90 views

Pgfplots: 3D plot with shader=interp and opacity

I have a rather simple question : is there a way to use shader=interp with an opacity factor in a surf mesh ? Here is an example that does not work: \documentclass{standalone} \usepackage{pgfplots} ...
2
votes
1answer
157 views

pgfplots in beamer class with BaKoMa TeX

I have a problem concerning plotting of functions in beamer class with pgfplots. I use BaKoMa TeX. In the article class, all works fine, but switching to beamer, an error occurs as soon as ...
1
vote
1answer
53 views

Make visible node text outside of pgfplot axes range

I'm using matlab2tikz in order to generate pgfplots .tex code to create a figure with pdflatex. The matlab function I'm using to create the figure creates each of it's tickmark labels explicitly, so ...
2
votes
0answers
29 views

Misaligned text strings in pgfplots with view option set

Please see this post for more background. The problem is that tick mark labels explicitly specified by code of the form: text(x(k),y(k),labs{k},'horizontalalignment',horizk,... ...
1
vote
1answer
30 views

Tikzexternal capturing crop marks when externalizing pgfplots?

Consider this MWE: % to rebuild: % rm test-testplot.pdf ; pdflatex -shell-escape test.tex \RequirePackage{filecontents} \begin{filecontents*}{testplot.tikz} \begin{tikzpicture} \begin{axis}[ ...
2
votes
0answers
51 views

Problem with pdfpc and latex-beamer presentations

I have a figure which uses pattern. The same behavior I notice with one of the examples of pgfplots, http://pgfplots.sourceforge.net/pgfplots.pdf page 211. When I use envince everything looks normal ...
2
votes
1answer
31 views

PGFPLOTS How to add an extra xtick or vertical line at the correct location?

I am trying to add a vertical line at the coordinate x= 3.5 to illustrate that this is the actual thickness configuration. However the attempt below does not put the tick at the right position on the ...
2
votes
1answer
35 views

Need to add for loop to add a lot of .csv files in the tikzpicture

I am trying to plot data from .csv file. I have a lot of .csv files (around 4000). I am not sure how to do this. I am looking for some kind of "for loop" to perform this. Any help would be ...
2
votes
1answer
32 views

How can I add/translate points in axis cs?

I don't seem to have a problem placing a coordinate in the axis coordinate system, and translating in the x direction seems to work as expected also. But as soon as I try to translate in the y ...
4
votes
1answer
53 views

Positioning text at node

This should be a simple question about positioning text with nodes using pgfplots. To make a skew node line with text I'd use \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat = ...
5
votes
2answers
185 views

How to draw this particular Mexican hat potential?

I know there are some other mexican hat questions here, but none of the answers seems complete to me. I would like to draw the following figure with TikZ with similar axis and labeling. How can one do ...
0
votes
1answer
26 views

How can I place an inset inside a pgfplots axis using the parent axis coordinates?

I'd like to place an inset axis inside a parent axis with pgplots. The position, width and height of the inset axis should be specified using the data coordinates of the parent axis. This is what I ...
1
vote
1answer
33 views

Make axis longer in 3dplot

How can one adjust the length of the axes in a plot made with pgfplots/TikZ without affecting the plot itself?
0
votes
0answers
22 views

Make axis semi-visible/dashed in TikZ 3dplot [duplicate]

Is it possible to make the axis fully visible for a certain range while merely dashed for some other range? Suppose the axes x,y,z all go from the origin 0 to 1. But I want them to be dashed between 0 ...
1
vote
0answers
45 views

Display resource usage as a Gantt Chart-like plot in pgfplots

I'm working with a distributed system which makes opportunistic use of connected resources. I would like to display the usage of the resources over time in a Gantt Chart-like plot, where resources are ...
2
votes
1answer
52 views

Setting ytick at defined positions within colorbar using TikZ/PGFPlots, no axis

yesterday i posted my first question (Problems to set ytick within colorbar using TikZ/PGFPlots, no axis) and i got really fantastic answers. Now it works as i wanted it to be. But i have still a ...
2
votes
0answers
45 views

pgfplots: rotating a shape in 3D independent of the axes

I have a group of shapes I'm plotting in 3D via \addplot3 (such as a cone) and need to have them pointed in a direction specified by the macro arguments. I do not want to just change the view angle or ...