{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
1answer
302 views

Plotting a function when date coordinates are used (pgfplots)

I want to plot a simple function on a plot where date coordinates are used in x but it seems that pgfplots cannot accept both. Here's a MWE of what I'm trying to achieve: \documentclass{standalone} ...
1
vote
1answer
214 views

Force 10 base multiplier

How can I get a 10 base multiplier at every tick? I only get 1 multiplier that has a strange position scaled y ticks={base 10:-3} I can't recreate it right now, however by default I got the lowest ...
1
vote
1answer
115 views

Weird Axis Labelling problem with 3D Plot Axes

Note: This was a bug and has been fixed This has been answered by Christian. It's a bug that had been resolved in pgfplots 1.8. I've updated my pgfplots and am now running 1.9. Similar Question ...
1
vote
1answer
128 views

Using a macro inside the axis options for pgfplots

I want to create an macro to replace the string '{a,b,c}' in my code: xticklabels={a,b,c} so I set \newcommand\inputnames{a,b,c} xticklabels=\inputnames but this gives me the same result as ...
1
vote
1answer
175 views

Complete Figure using Tikz

I want to draw the figure where x size and y size will be different. Mark of x will be like 10, 20, 30 etc. and y will be 0.1, 0.2, 0.3 etc. It will be also nice if there is a small grid in the back ...
1
vote
1answer
408 views

Plotting 1/x not correct in pgfplots? [duplicate]

When I'm drawing f(x)=1/x or similar functions, pgfplots draws asymptotes. Do I have to draw the function in two pieces with different domains, or am I missing something? ...
1
vote
1answer
144 views

Adding horizontal space between plots in pgfplot

I couldn't find any solution for adding horizontal space between two plots in pgfplots. The xshift thing didn't help. Here's the code: \documentclass{sigplanconf} \usepackage{pgfplots} ...
1
vote
1answer
164 views

Gap between xaxis and bars in tikzpicture

I am adding a bar chart with tikzpicture and I am getting a strange gap between the bars and the y axis. Am I doing something obviously wrong? Because my other bar charts works fine... Should I ...
1
vote
1answer
108 views

adding complexity to a hyperbolic trajectory

Jubobs generated this code from Drawing a hyperbolic trajectory. If we draw a horizontal line that intersects the hyperbola (I really dont want to add this to the picture), we would have some angle. ...
1
vote
1answer
168 views

Bad horizontal alignment in pgfplots figure

If I try to horizontally align two nodes by giving the same y-coordinate, the text $D_{\textrm{X-ray}}$ and $D_{\textrm{C-ion}}$ is still not aligned properly, which has apparently to do with the ...
1
vote
1answer
168 views

Move ylabel with pgfplot

My ylabel is to far from ticks and I would like to make it closer. Especially ylabel of the right plots. \begin{tikzpicture} \begin{axis}[% view={0}{90}, width=5.5cm, height=4.5cm, scale only axis, ...
1
vote
1answer
881 views

Bold Y-Tick Label and Every Node Near Coord

I can make my xticklabel apply \bfseries, I can make my xlabel and ylabel apply \bfseries. For some reason, I cannot seem to get my yticklabel to apply this effect. At least when I compare the "1" ...
1
vote
1answer
345 views

pgf stacked bar graph with line plot

I want to draw a stacked bar graph plot with one parameter as a line plot. Here is my code below - \begin{tikzpicture} \pgfplotstableread{Figures/measurements.dat} \datatable ...
1
vote
1answer
178 views

PGFPlots: strange behaviour

Look at the differences between the following two plots. I would like to have in plot "1" the same distances between the colorbar, axis labels and the ticks labels that I get in plot "2". How can ...
1
vote
1answer
1k views

How to include extra ticks in pgfplots without them appearing in bold face?

In order to include a cross through the origin in my plot, I write the following under \begin{axis}: extra x ticks={0}, extra y ticks={0}, extra tick style={grid=major}, However, the 0s appear in ...
1
vote
1answer
285 views

pgfplots: externalization and ifthen

I use pgfplots with externalization. When I try to include a macro that uses \ifthenelse, always the 'else' statement is being executed. When I switch off externalization, it works again. See this ...
1
vote
1answer
695 views

Using \footnotesize in tikz node labels

I have used \footnotesize to scale labels before and it has produced the desired results. But am having problems when I pass this as part of the label to a macro. The following MWE compiles but not if ...
1
vote
1answer
1k views

\pgfresetboundingbox is undefined control sequence?

I'm sure this question has a simple answer that I'm missing: I'm trying to use pgfplots to put two graphs right next to each other with no space in between. I thought I could do this by using the ...
1
vote
1answer
46 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 ...
1
vote
1answer
67 views

Scaling pgfplot with tikzscale

I'm using tikz and pgfplots for graphs. When using a second y-axis on the right the scaling of tikz is not proper. So I tried to use the tikzscale package and the includegraphics but it seems to scale ...
1
vote
1answer
113 views

PGFplots - single legend in a group plot [duplicate]

I have a group plot and when I try to add a legend it repeats on all subgraphs. I want a single common legend line at the top of the whole graph. \documentclass{standalone} \usepackage{graphicx} ...
1
vote
1answer
65 views

PGFplots multiple ylabels

I want to have multiple y labels in a group plot. Now I have 4 different values for ylabels:Range1, Range2, Range3 and Range4. I want to add a common ylabel say "throughput". How do I do that? ...
1
vote
1answer
50 views

after end axis messes up pgfplots axis position

Latex and Tikz are going to get the life out of me... I saw Need to do some changes to pgfplots axis #39099, and that example was working fine for me; so I modified it a bit, and came up with the ...
1
vote
1answer
71 views

PGFPLOTS boxplot data from inline file

I have The following code: \documentclass{article} \usepackage{filecontents} \usepackage{pgfplots, pgfplotstable} \usepgfplotslibrary{statistics} \begin{document} ...
1
vote
1answer
61 views

Loop through table for boxplot prepared

I am trying to produce figure with 2 boxplot prepared plots from an inline data file. I grabbed this code from here to use as a starting point. Given that the wrapper code allows the boxplot data to ...
1
vote
1answer
173 views

Engineering notation (scientific) as tick labels with pgfplots (maybe via siunitx)?

I would like to have numbers on the ticks labels formatted in engineering notation -- but unlike in How to control pgfplots axis scaling for engineering notation (multiple of 3 exponent)?, I would ...
1
vote
1answer
149 views

String column tick labels and plotting selected samples on y axis with groupplots?

I have seen other relate questions (like Basic bar chart with text as x axis labels), but still cannot figure out where the problem is in my example. The MWE below contains a snippet of a .csv table ...
1
vote
1answer
111 views

Can I make an xbar plot based on an external file?

I'd like to use the, imho, most common value alignment of x- and y-values in an external file and then produce an xbar with it. It shall look like the examples here (the better example because there ...
1
vote
1answer
133 views

Overlapping transparent impulses (ycomb) with pgfplots?

Consider the following MWE: \documentclass[% 12pt, journal, twoside, draftcls, letterpaper, ]{IEEEtran} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{tikz} ...
1
vote
1answer
91 views

How can I resolve the side effects of AddEverypageHook to external pgfplots?

I have quite a huge document with many pgfplots, which I would like to externalize. Well I can externalize them, but my \AddEverypageHook command from the everypage package affects this externalized ...
1
vote
1answer
167 views

rectangle in 3d plane

I am trying to plot a 3d axis with a rectangle perpendicular to the x-plane using the following code: \documentclass[tikz]{standalone} \usepackage{pgfplots,pgfplotstable} \usetikzlibrary{calc} ...
1
vote
1answer
120 views

Place coordinates halfway (or 75%, etc) up the plot

I am using this macro \newcommand{\ymax}[0]{\pgfkeysvalueof{/pgfplots/ymax}} to do stuff like the following: \draw[dashed] (axis cs:4, \ymin) -- (axis cs:4, \ymax); and this works fine. ...
1
vote
1answer
369 views

How to extract/convert tikz to a format suitable for powerpoint

I am trying to extract/convert a tikzpicture to a format that is suitable for powerpoint without losing quality. The code that I have found and adjusted is the following: ...
1
vote
1answer
85 views

pgfplots tick lines are behind const plot

The tick lines in the plot are in a layer behind the actual plot. Have a look at this example below: \documentclass[11pt, oneside]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
1
vote
1answer
262 views

datetime plot in pgfplot using gnuplot

I have a large data file with several columns wherein the first column is a date and time in the format, 'yyyy-mm-dd hh:MM' and the rest are numerical values of different variables. I often have ...
1
vote
1answer
501 views

Legend marker in pgfplot bar chart

I spent the last hours trying to solve this issue. I hope you can help me, sorry if the answer appears clearly somewhere else, I was not able to find it. I would like to adjust the marker/symbol in ...
1
vote
1answer
109 views

Composite plot in PGFPlot

I am trying to get pgfplots to do produce a plot like the following: i.e. a scatterplot with a second scatterplot below the x-axis. I am having a hard time figuring out how this kind of plot is ...
1
vote
1answer
95 views

Position of colorbar with multi plots without using groupplot

I have 6 plots (2 rows, 3 columns) with the same colormap and I want to put only one colorbar on the top of the plots. Using anchor and at does not give the expected result, I think this is because ...
1
vote
1answer
320 views

pgfplots: multiple legends or one legend and a heading

In my plot, I want my standard legend that says what value of c corresponds to what color. However, I would also look to put the function in plot. \documentclass[tikz]{standalone} ...
1
vote
1answer
250 views

Only the old version of pgfplots is available with MiKTeX (version 1.7)

I am looking for a solution to install the last version (currently 1.8) of pgfplots via the package manager MiKTeX on Windows. However, MiKTeX only offers the old version 1.7 of pgfplots. Is there a ...
1
vote
1answer
66 views

Problem with referencing plots

I want to reference some plots (done with pgfplots) in my text but somehow it's not possible. If i copypaste the examples from the pgfplot- documentation it works but if I move one of the labels to ...
1
vote
1answer
129 views

Scale only dataset read from file without scaling whole graphics

I have datasets which vary strong in range. So i want to scale my dataset to adjust it to my template, so that the grids, axes and so on are identical with the neighbour-subfigures. What is the ...
1
vote
1answer
258 views

Including a tikz figure with a reference to a table on file, problems with folder structure

I am trying to include a tikz figure in the chapter 6 of my thesis. I am using separate folders and .tex files for each chapter, as you may notice in the example. This means that in my main document I ...
1
vote
1answer
159 views

Set xstep and ystep pgfplots

I have this MWE. My question is how can set xsep and ystep in the axis so that they will properly appear, and without have to know in prior the range of values: xtick={0,0.1,...,1}, ...
1
vote
1answer
311 views

Pgfplot figure off-center

I create a tikzpicture in standalone mode (see code below). Then import the resultant .pdf file into my document via \includegraphics (see pic). However the axis labels are cut off and part of the ...
1
vote
1answer
454 views

Problem in modifying contour label style in pgfplots

I am trying to modify the contour label style in a TikZ picture. I would like to have the label values in the format 0.0 instead of being integers. The following code produces a picture in which ...
1
vote
1answer
383 views

Debugging TikZ and PGFPlots compatibility issue

I just tried to compile an old TikZ code (which as far as I recall compiled perfectly in the past and was not changed in the meanwhile) and I faced some serious compilation issues related to TikZ. ...
1
vote
1answer
94 views

Specifying ymin in pgfplots misalignes images vertically [closed]

I have two plots drawn with the \pgfplots package. In one of them, I specified that ymin=0 when I created the axis since the plotted curve never goes below y=0 (otherwise something like ymin=-0.2 ...
1
vote
1answer
168 views

pgfplots externalize and references: some work, some don't

I have started using the tikz externalization library for my current project. From here I learned to use \pgfplotsset{invoke before crossref tikzpicture={\tikzexternaldisable},invoke after crossref ...
1
vote
1answer
309 views

Vertically aligned legend to PGFPlots subplots

What I want to do is to have 3 PGFPlots subplots and the legend arranged in four equally sized boxes. However, when I use the following code, in the output the legend is not vertically aligned with ...