Tagged Questions

{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

2
votes
1answer
82 views

Scatter plot with a grid and axis lines going through the origin

I want to make a scatter plot with error bars (using pgfplots or tikz) with two characteristics; I need the two axes to meet at (0,0), and a grid in the background. I tried to google this a number of ...
2
votes
1answer
89 views

Is it possible to assign to two extra x-tick labels different colors?

I think the question says it all. I'd like to have two extra x tick labels with different colors. I thought of using a cycle command, but I couldn't figure out how it should work. I changed the color ...
1
vote
1answer
56 views

pgfplots - How can I address the coordinates of a plot's title in a groupplot?

Say I provide a title to a groupplot via title={Word} Is there a way to address the area of this node, e.g. via .north west and so on (as detailed on page 314 in the manual)?
3
votes
0answers
110 views

pgfplots groupplot: fillbetween breaks alignment of plots

I recently (foolishly) updated all my TeXlive packages, including pgfplots (from 1.10 to 1.11). I now have an issue with the groupplots and fillbetween libraries, where using the fillbetween library ...
4
votes
1answer
107 views

Expressing a y-only shift with `axis direction cs` with symbolic x coords

I have a vertical bar chart with error bars. I want to put a star just above or below the error bar where the results are significant. I achieved this using the very neat trick provided in this ...
4
votes
2answers
113 views

pgfplots - How can I print the y tick scale label only once in a groupplot?

I'd like to have the tick label for the y-axis only printed once in a groupplot. This would be very useful for the case when one uses the following options: ylabels at=edge left, yticklabels at=edge ...
3
votes
1answer
55 views

Missing something obvious with tick label styles in pgfplots [duplicate]

Why does this not produce y tick labels in fixed number format? (pgfplots version 1.9 produces y tick labels in scientific format) \documentclass[12pt]{article} \usepackage{pgfplots} ...
2
votes
4answers
265 views

Plotting several functions with TikZ/pgf

How do I plot several functions in Latex with tikz? I want it to look something like this: With the this code: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage{tikz} % GNUPLOT ...
2
votes
0answers
137 views

Contour plot of data, where the data is of the form x_i, y_i, f(x_i,y_i)

I would like to plot the following data in a contour plot using pgfplots: data.txt. The data is of the form x_i, y_i, f(x_i,y_i) and contains NaN values. I am able to plot this exact data in a surface ...
3
votes
3answers
890 views

How should I start with this image?

I have an old image with ppt style and I would like to customise it a bit. Main problem is I'm a beginner in Tikz/PGF and i really don't know where to start and which environments I should use. If ...
3
votes
0answers
52 views

Reduce number of input files for group plot in pgfplots [duplicate]

In the pgfplots groupplot below, I have three sets of data represented by data1, data2 and data3. Each of the data have three subtypes. And I need to plot a graph for each of the subtype. The file ...
1
vote
0answers
40 views

Surface plot of data does not produce expected result [closed]

I would like to make a surface plot of data.txt. I use the following code as a MWE. \documentclass{article} \usepackage{tikz,pgfplots} \pgfplotsset{compat = 1.8} \begin{document} ...
1
vote
3answers
278 views

How to create a 32 by 32 grid?

I want to create a 32 by 32 grid as shown below. And I also want to add two labeling in x and y directions. 1) 0 - 31 (grid number) 2) 0- 1 (box unit) I a next slide I have to draw a new box ...
0
votes
0answers
84 views

Visualizing Cluster Data

the question in the headline is formulated very abstract, because I am still not sure what the best way of visualizing the Data I have is. The problem is that I have two mappings of a dataset which ...
5
votes
1answer
76 views

Adding node to last coordinate

I have a loglog plot and would like to highlight the last coordinate. For example \begin{tikzpicture} \begin{loglogaxis}[] \addplot+[] coordinates{(0,0) (2,20) (3,100) (4,4000)}; \end{loglogaxis} ...
1
vote
1answer
70 views

TikZ Issue With Function Plotting

I am trying to create this simple TikZ plot of a quadratic function. But the code does not compile, and the error is detected at the part where I introduce the function. What is wrong with it? ...
4
votes
2answers
216 views

Trouble with Tufte-style bar chart

I am studying this article: "Tufte-style Bar Charts with pgfplots". I was able to come up to step #4, and was stuck, removing the border from the bars: \definecolor{tufte1}{rgb}{0.7,0.7,0.55} ...
1
vote
2answers
92 views

Interval of x tick labels are to close

I have some trouble with the interval of the x tick labels. I have two much labels so the text overlap each other. My code is following: \begin{figure} \begin{tikzpicture} \begin{axis}[ ...
9
votes
3answers
286 views

First half of plots is missing

I want to draw some functions with gnuplot. It works well, but the first half is missing and I don't know why. \begin{figure}[htpb] \begin{center} \begin{tikzpicture} ...
3
votes
1answer
91 views

\addplot3 in pgfplots plots data beyond axis limits

When using pgfplots for a 3D graph and reading the data from a table, is there a way to truncate the data at the axis limits specified in the axis environment ? Here is a MWE: ...
2
votes
0answers
22 views

pgfplots: plot data table until n-th line [duplicate]

Is there a way to plot only the first n-th lines of a data file using pgfplots? Currently I'm plotting the whole csv-file using (MWE): \documentclass{article} \usepackage{pgfplots} ...
4
votes
1answer
54 views

Change pgfplot auto tick distance

I have data that is measured in a seconds scale. If I plot the data using pgfplots, the automatic tick labes are multiples of 100. Because the axis is "time", I would like to be the ticks multiples of ...
6
votes
1answer
146 views

Fill area in tikzpicture

Can somebody help? The fill area is not symmetric. The goal is to be symmetric. \documentclass[10pt]{article} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} ...
2
votes
2answers
160 views

How can I make a simple graph with grids using pgfplots?

I want it to look like this: Preferably with comments so I can learn how to make my own!
11
votes
1answer
302 views

How to plot the first n rows of a table using pgfplots?

When using pgfplots, is there a way to plot only the first n rows of a given table ? Considering the following MWE file: \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
0answers
26 views

Use data from other multiple data files with calculations [duplicate]

This answer shows nicely how to use data from another file while plotting data using \addplot table. However, when trying to access the create on use column using \thisrow{}, an error occurs. For ...
3
votes
1answer
88 views

Axis rotation and alignment

I have a problem to rotate an axis. Here is the code I use where the problem occurs : the two axis origins are not aligned. \documentclass[a4paper,11pt,twoside]{article} \usepackage[pdftex, active, ...
1
vote
1answer
204 views

pgfplots: two y-axis with three plots and one legend

After googling about my problem, I came up with this two year old question here on TeX.SX. I adopted the example from there having two plots in the first axis-environment and one plot in the second ...
2
votes
2answers
97 views

Change edge color of pgfplots patches

I am plotting patches and don't them to be colored according to their z-values. Instead, I want to define the colors by myself. Here is an example: \addplot3[area legend,patch,forget plot,patch ...
5
votes
1answer
128 views

Unclutter a bar plot with pgfplot

I have the given bar plot with three hirachies (color + inner-group + outer-group): The figure look overloaded but I don't know how to split the x axis labels in a better way. A possible solution ...
0
votes
1answer
123 views

How to place two bar charts beside each other

There are two tikz barcharts in this snippet. I'm able to display barcharts one after another but when i use subfigure/subfloat its giving an error \documentclass[preprint,12pt,3p]{elsarticle} ...
2
votes
3answers
132 views

Overlaying or nesting graphs in tikzpicture with different axis scales

I need overlay or nest a figure in a graph. I try with \pic, but the results aren't good for figure scale, according to graph scale. I try also to define the figure in nodes, to place it in the ...
9
votes
1answer
113 views

How can two bivariate normal distributions be plotted in one plot?

I would like to visualize the following two bivariate normal distributions: I found Jakes awesome answer and adjusted it so that the plots get rotated the correct way. Current plot Question ...
4
votes
1answer
148 views

convert gnuplot script to pgfplots using “raw gnuplot” option

I'm trying to rebuild a plot from "standalone" gnuplot with pgfplots using the raw gnuplot option. This is the gnuplot code which generates the desired graph: #!/usr/bin/env gnuplot set xlabel "Time ...
7
votes
1answer
168 views

How can I import matrix data (2d function) from matlab into pgfplots?

This question arised in Spectrum colormap for multiple curves, but since it is of general interest, I add a separate question and my answer here. Suppose you have a matlab figure which needs to be ...
4
votes
1answer
71 views

pgfplots: symbolic coordinates with line skipping

I am trying to skip lines inside the symbolic X coordinates of the following pgfplots Bar Chart : \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{color} \usepackage{amsmath, ...
7
votes
1answer
178 views

TikZ/PGF 3.0 datavisualization vs pgfplots

To follow-up on a previous question TikZ datavisualization or pgfplots?, the current release of TikZ 3.0 has a flexible datavisualization engine that creates the same kind of plots as the more mature ...
3
votes
1answer
98 views

How can I mark a point in a pgfplot and make sure its visible (on top of the plot)?

Recently, I have TikZ'ed the following image for Wikipedia (see file) I would like to mark the green dot like it was done here: I've tried a couple of different things, but no matter what I did ...
2
votes
1answer
55 views

How can I place a node relative to a legend?

I'd like to place custom formatted nodes relative to the legend in a plot. The answer to Placing node relative to legend is a solution per se, but related to op's actual intent so it isn't helpful to ...
2
votes
0answers
83 views

Conversion of big “amount” of seconds into HH:MM:SS when plotting timeseries with pgfplots

My aim is to plot a timeseries (experimental data) using pgfplots in LaTeX (pdfLaTeX, TexLive on Mac). The data I'm using is seperated with semicolons (columnwise) and has the following structure: -- ...
3
votes
1answer
172 views

Very fancy bar chart

Just wonder if this could be done with tikz? I know I should provide at least a MWE, but I am new to latex and have absolutely no idea where to start. MWE (Addition by HK) ...
1
vote
1answer
68 views

Overlapping ticks and figure not centered with matlab2tikz

See the printscreen. What I want is that the figure is centered, now that is not the case with using \setlength\figurewidth{1.0\textwidth}. Besides that the ticks with negative signs on the x-axis are ...
3
votes
0answers
72 views

create bar chart from select table row(s) for select column

The code below creates a bar chart but does not use the included data table. I would like to create the chart for an arbitrary year by specifying the year and using the table. Possible? ...
5
votes
1answer
318 views

Spectrum colormap for multiple curves

I have been using matlab2tikz to generate a lot of my plots, but I am finding it struggling at this particular job so would like to inquire about how to do it properly in pgfplots / tikz. Essentially ...
6
votes
2answers
186 views

Riemann sum with pgfplots — can't seem to make graph look right

I'm trying to reproduce something like this with the function x^-1, but no matter what options I try, I can't seem to make the graph look correct. This is my current code: ...
5
votes
2answers
176 views

Filling an angle arc with a pattern

Consider an angle (on a plane) with the vertex O, the initial side (ray1) and the terminal side (ray2). Assume the measure of this angle is less than 360 degrees. (There are two such angles.) ...
3
votes
1answer
55 views

Setting zmin/zmax in groupplot confuses colorbar creation (colorbar is 3d)

When using groupplots and setting zmin and/or zmax in the groupplot environment manually, pgfplots generates a (broken) 3d legend: I assume the issue is that groupplot passes the zmin/zmax settings ...
4
votes
3answers
229 views

Hatching a rectangle leads to solid line in beamer

I would like to indicate an inequality constraint using a hatched pattern. This is to be done in a pgfplot, that is itself part of a beamer frame. Here is an MWE: \documentclass{beamer} ...
3
votes
1answer
119 views

Plotting data from set of files in pgfplots

I have a large number of files containing xy-data that I would like to plot in one plot. I know I can do that manually and bit by bit which is ok for only several files, but not for larger numbers. ...
5
votes
1answer
72 views

`pgfmathresult` in a command

The following code doesn't work : \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning, calc} \newcommand\machin{ \pgfmathparse{1} \pgfmathresult } ...