{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

1
vote
0answers
355 views

PGFPlots - no lines between marks [closed]

I am starting playing with plots in latex. In my preample I have: \usepackage{pgfplots} \pgfplotsset{width=12cm,compat=1.9} My plots code: (first is copy from from tutorial, second is my attempt) \...
4
votes
0answers
323 views

Problems with pgfplots, loops inside tikzpicture and reading from files

I was trying to implement this method (How to import ASCII coordinates to TikZ) to import coordinates and draw them, but I am having this problem Undefined control sequence \end{tikzpicture} Extra }, ...
4
votes
1answer
192 views

Use column header as labels for x ticks

With pgfplots, it is possible to let the xticklabels be given by one column of a table. However, is it possible to import it from the table header ? In my concrete case, I have a table with two ...
4
votes
1answer
403 views

Draw lines inside tikz plot (exported from matlab), independent of coordinate system

I am exporting plots from matlab with the matlab2tikz package. While this works just fine, I now want to insert some lines and text to describe the plot. I have multiple plots which are to be labelled ...
5
votes
1answer
3k views

Plotting semilog plot with pgfplot

I am trying to graph frequency response of certain filters. This is the code I currently have: \begin{tikzpicture} \begin{semilogxaxis}[xlabel=Frequency, ylabel=Gain, xmin=1, xmax=20000, ymin=0, ymax=...
7
votes
0answers
134 views

How to create vertical Bullet Graphs with PSTricks? [duplicate]

I was looking for a package to create bullet gauge graphs, but I couldn't find any. A good person in this forum show me how he would make it in TikZ, with a little options. I was waiting any moths ...
2
votes
0answers
583 views

LaTeX Box plot drawing using pgfplots [closed]

Two issues I have in the following code. I want to put the box in the middle of the line and I like to show the for the maximum value. Any suggestion will be appreciate. Thanks. \documentclass{...
5
votes
2answers
451 views

Opposite command of “restrict y to domain”

How can I obtain the exact opposite of the command restrict y to domain? I have data in a table and I would like to color points inside [min:max] as black, and points outside [min,max] as red. I ...
7
votes
0answers
358 views

“Segmentation fault (core dumped)” with LuaLaTeX [closed]

I'm trying to compile a 3D surface made by 10000 data points with tickzpicture. However, when I compile the .tex file with lualatex lualatex --shell-escape myfile.tex I receive the following error: ...
15
votes
2answers
470 views

Is it possible to detect the “current color”? (for example in a pgfplot drawing?)

Is there a code to deduce the current color of a PGF plot to which a node is associated? Better yet, is it possible to get the RGB decomposition as well? ... addplot coordinates{ (0,0) (1,1) } node{ "...
4
votes
1answer
397 views

pgfplots - divide y-axis in 2 parts

I have a plot, code here. Now the problem I have is that because of the scale of y-axis it looks as if the plots are actually just 3 lines. Now what I want is that the y-axis is sort of splitted. Into ...
0
votes
1answer
1k views

label font size in matlab->matlab2tikz

Does anyone knoy how can we increase the labels fontsize when we use the matlab2tikz (see this link) function from the mathworks file exchange? I always have to access the *.tikz generated file and ...
2
votes
2answers
515 views

Negative y value in polar plot

I'm having some trouble with polar plots. I have to plot negative values, but without changing direction. I tried to set the ymin value to be negative, but it doesn't work. \documentclass[10pt,border=...
62
votes
6answers
5k views

Filling specified area by random dots in TikZ

I want to reproduce the following diagram in Tikz. LaTeX code of my MWE is below: \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \draw [-latex, ...
6
votes
1answer
494 views

pgfplots: group stacked bars

I'm trying to create groups of 5 stacked xbars, using y expr={\thisrow{y} - (mod(\thisrow{y},5)/2)}. However, after some groups, the calculation seems to get thrown off and the third group actually ...
4
votes
1answer
200 views

plotmarks are displayed as default marks

My code: \documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepgflibrary{plotmarks} \begin{document} \begin{...
1
vote
0answers
1k views

How to adjust the inner and outer margin spaces around legend in PGFPlots?

How can I adjust the inner/out right/left/top/bottom margins of legend in PGFPlots? (not the space between the legend entries) e.g. indicated in the below figure.
5
votes
1answer
955 views

PGF Math: “An internal routine of the floating point unit near”

I am using this snippet: \documentclass{beamer} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ylabel={$f(x) = x^{-1}$} ] \addplot {x^{-1}}; %...
1
vote
0answers
38 views

Define styles to make series of similar pgfplots [duplicate]

I'm writing a journal paper, and in this paper, I have to produce many versions of the same graph as I look at the effect of varying different parameters on the variable of interest (in this case the ...
4
votes
0answers
298 views

How to draw this 3D H-layout recursive tree with Tikz? [closed]

Background: This is an extension problem from my last post How to draw the recursive H-Layout tree using Tikz?. The (2D) H-layout tree is actually from the VLSI layout problem in computer science. I ...
4
votes
1answer
1k views

Settting PGFplots axis environment options by means of \newcommand and {\newlength,\setlength}

Because I often use the same options for multiple axes in my LaTeX documents, I use the following code to simplify my life. \documentclass{article} \usepackage{pgfplots} \newcommand{\linecolora}{blue}...
3
votes
0answers
1k views

PGFPlots: importing data from a txt file

So I imported data from two txt files. However, I would like to plot the mean of the data and then the standard deviation bars. How can this be done? \documentclass[tikz, convert = false]{...
18
votes
4answers
2k views

What is the best way to produce TikZ picture for discrete signals?

I would like to draw discrete signals, as shown in the illustration below, but not by way of drawings of individual lines.gnuplot could be used for this work? It would be nice to be able to choose the ...
12
votes
1answer
1k views

pgfplots: colorbar: align y ticklables to the right

I have a colorbar in pgfplots and would like to have the y tick labels aligned to the right. Using colorbar style={yticklabel style={align=right}} did not work for me. The left colorbar shows the ...
3
votes
2answers
340 views

How to expand a plot in a matrix over 2 or more matrix elements?

I use a matrix to arrange and align plots in a groupplot (as discussed here) and I want to create a groupplot with one subplot which have the size of for example two subplots as shown below. I ...
5
votes
1answer
456 views

How to set bounding boxes of groupplots for aligning purposes?

How can I set the bounding box of a groupplot to the left and right outer axis of the subplots in the groupplot? In my MWE are three plots and I want to align the outer axis of the groupplots with ...
4
votes
1answer
717 views

Superposing histogram and barplot (with transparency)

I'm having troubles when I try to plot in the same graph a bar plot and an histogram. This is my MWE (you can find my data set at the end of the post). \documentclass{standalone} \usepackage{...
8
votes
1answer
793 views

Inverse Hyperbolic Functions in pgfplots

What I want is to plot a function that includes an inverse hyperbolic sine in it. This is my code/ \documentclass[border= 5mm]{standalone} \usepackage{pgfplots} \usepackage{amsmath} \...
0
votes
1answer
620 views

Package collision matlab2tikz and legend in polaraxis. pgfplotset and multiple size definition problem

How can plots, created by matlab2tikz and common tikzpicture-polaraxis be correctly used within the same document? The example is of the structure packages, matlab2tikz-pic1, matlab2tikz-pic2 and ...
8
votes
1answer
562 views

How to generate random closed shape and draw a line bisecting it

Similar to this question, except I also want a single line bisecting the shape in both area and perimeter. So the dream is to end up with a shape like the ones shown here, and a single line through ...
5
votes
1answer
768 views

Missing bars in pgfplots histograms

I have a problem with pgfplots, when I try to plot some data from a file. I use the following code \begin{figure}[p] \centering \begin{tikzpicture} \begin{axis}[ybar interval,xtick=,width=\...
13
votes
2answers
7k views

Positioning a tikz scope relative to another tikz scope

In the manual of PGFplots on page 333 the author describes how to position an axis environment relative to another axis environment: \begin{tikzpicture} \begin{axis}[name=plot1,height=3cm,width=...
7
votes
1answer
3k views

pgfplots: enlarge x limits while using x min/max

The problem: I like to use enlarge x limits to have some white space to the axes. I now often load in my data (generated elsewhere) but only want to plot a specific range (using x min/max). Now, doing ...
4
votes
1answer
378 views

Want pgfplots to display base 10 exponent as tick labels

Basically I want the labels beside the tick marks on a log axis displayed as 27,28,29,... and not as 10^27,10^28,10^29,... The closest I can get is by defining the number format to be only the ...
25
votes
4answers
1k views

A rather difficult ring like picture to be drawn

I desire a figure similar to the following: \documentclass[tikz,margin=10pt]{standalone} \usepackage{mathtools,amssymb} \begin{document} \begin{tikzpicture}[scale=2,transform shape] \draw (1,0) ...
1
vote
1answer
320 views

Revisiting: Plotting Population Regression Function with pgfplot

I want the make the following population regression function after some modifications with pgfplot (response from previous question here). Required Modifications Draw small circle at each normal ...
3
votes
2answers
3k views

matlab2tikz and legend location

I have a matlab plot given below, that is converted to tikz. Let's call it myfile.tikz \begin{tikzpicture} \begin{axis}[% width=\figurewidth, height=\figureheight, scale only axis, xmin=1, xmax=3, ...
12
votes
1answer
521 views

nodes near coords with logarithmic axis: Wrong values

I created a horizontal bar plot to compare benchmark times. Since one of the tested components is really slow, I need a logarithmic y axis for the other values to be distinguishable. Combined with "...
5
votes
2answers
673 views

Wrong tick labels alignment on baseline

Here is an example replicating a problem I faced using the xticklabels from table feature: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \usepackage{siunitx} \begin{document} \...
8
votes
1answer
787 views

Prevent PGFplots from using 10^notation on y-axis

I want the y-axis labels to be labeled 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10,000, … PGFplots insists on keeping the 10^-notation in the following minimal example. \documentclass[...
5
votes
1answer
209 views

How to put data labels next to the text labels in a bar plot? (2nd edition)

I had asked an earlier question How to put data labels next to the text labels in a bar plot?. While the solution provided worked for the specific input data values in that example, when I tried to ...
4
votes
1answer
2k views

Create 3D heatmap desity plot using TikZ

My question is very similar to "Create heatmap with PSTricks or TikZ", but this time in 3D. So I have tabulary data as follows: x | y | z | value 1.2 | 1.3 | 1.4 | 1.20 0.2 | 0.3 | 0.4 | 3.20 ...
4
votes
1answer
4k views

smooth pgfplots curve

How do I smooth this curve? Tried using gnuplot but its not working. \documentclass[convert={density=400,outext=.png}]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \...
4
votes
1answer
362 views

pgfplots: Plot only parts of table and in “random” order

I have been lurking around stackexchange for a long time and so far been able to find solutions for my newbie problems but now I'm really stuck! My problem is probably not that complicated, yet a bit ...
5
votes
1answer
3k views

Bar plot with error bars and two data rows

I am already close to the solution I'm searching for. I want this graph http://tex.stackexchange.com/a/35749/38544 with two data rows. Thus I took the code, duplicated the addplot-section and removed ...
2
votes
0answers
344 views

Tikz “Times Roman” in axis labels [closed]

How do I set my axis labels to use Times New Roman or Times Roman fonts, please? I'm looking for something similar to: \pgfplotsset{every axis/.append style={font=\sffamily\scriptsize}} which works ...
2
votes
0answers
243 views

How to align bars with the legend?

I'm able to draw bar chart using tex file mentioned below \documentclass[landscape,a3paper,11pt]{article} \usepackage{pstricks-add} \usepackage{pgfplots, pgfplotstable} \begin{document} \begin{center}...
3
votes
2answers
285 views

Add straight line beneath a plot

I would like to add straight lines beneath a scatter plot for instance in order to delimit the region where |y| < x and |y| < 2 * x. I wrote something similar to th code below which give ...
8
votes
1answer
1k views

PGFPlots Parametric Plot, Arrow Spacing by Constant Time

For a parametric plot of a particle's position (x(t),y(t)), is it possible to usepgfplots to draw arrows equally spaced in time to indicate the direction of travel? For example, with (x(t),y(t)) = (t,...
1
vote
0answers
231 views

pgfplot log-log plot: Axes Exponents [closed]

I have a question about formatting the axes using pgfplots in LaTeX. For some reason the exponents in my log-log plots (base 10) are fractions instead of whole numbers, i.e. instead of having 10^1, 10^...