{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

3
votes
1answer
539 views

curious xticklabel style error

I'm receiving the strangest error when trying to plot a simple graph. Let me show you - this works: \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
1k views

Modify the legend-style in pgfplots

I have a question concerning pgfplots. I made a minimal example which is related to the example in the pgfplots manual (page 182): \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} ...
3
votes
1answer
359 views

Omit overlapping xtick labels

So right now I have something like this: As you can see, the xticks on the second (smaller) plot are a complete mess. Is it possible to just show 3 values (the first, midpoint and last ones)? ...
3
votes
1answer
588 views

How to use `ybar interval` without skipping the last value

I have the following code \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents}{testdata.dat} -3.316988309367815e-07 ...
3
votes
1answer
664 views

Addplot3 with graphics / Image Offset to Axis

I'm currently working with tikz and pgfplots to set a few plots. It works marvelously for a lot of applications, add I have set a number of plots (especially surfaces from matlab) with help of the ...
3
votes
1answer
1k views

Undefined control sequence \text when importing Matlab figures

I'm following a tutorial to import Matlab figures through tikz, however after trying to compile the .tex file I get the following error: ABD: EveryShipout initializing macros (./mysphere.tikz ! ...
3
votes
1answer
576 views

Adding extra ticks inside the axis environment

I am wondering if it is possible to add extra ticks to a plot without declaring them in the options of \begin{axis}. Consider the following example, where I would like to have the coordinates of the ...
3
votes
1answer
1k views

pgfplots grouped bar chart from file

I am trying to create a grouped bar chart with pgfplots from a file that contains a data table. However in the resulting picture the bars are not grouped but on top of each other. Every working ...
3
votes
1answer
135 views

Force re-reading a data file

I have a data file from which I want to plot odd/even rows seperately, in the same axis. But the table options seem to apply only once, when reading in the data, which only happens once per axis (i.e. ...
3
votes
1answer
742 views

get max/min value in a table column with pgfplot

I'd like to get the max/min value from a specific column table via function \findmax and \findmin in order to use it in ymin and ymax. I really dont get how \pgfplotstablesort function works. What ...
3
votes
1answer
213 views

Pgfplots: How to make the plot exceed the axes

I am plotting a spike using pgfplots. I want to make the y-axis until (4) only. However I want the plot of the spike itself to continue beyond the y-axis (say until 10). Is there a possible way to do ...
3
votes
1answer
368 views

How to plot data from multiple filters using pgfplots

I'm searching for a way to apply multiple filters to a data input and plot the result of each filter in one axis environment. I found the following question which applies one filter but uses the ...
3
votes
1answer
238 views

Problem with snake ticks in pgfplots for bell shaped normal distribution

I want to draw two sided created region for normal distribution (see figure below). I have issue with snake ticks proper alignment and area looks suspicious to me. Am I missing something here? Any ...
3
votes
1answer
651 views

Spacing bar between bars is too high in a bar plot with error bars [closed]

\documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ title = {ring enrich.}, ybar, width=10cm, xtick={1,2}, xticklabels={% before, after, }] ...
3
votes
1answer
546 views

Histogram fill with logarithmic scale

I face a "filling" problem when I run one of the pgfplots example but with y-log scale. Here is the MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
483 views

Problem with x filter when trying to filter points according to x value

I am trying to filter points according to its x values. The data may be from a table-formatted text file, or directly typed in coordinates{...}. I tried to use x filter/.code, but for data from text ...
3
votes
1answer
315 views

Bringing the parts of a bar chart closer

In the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...
3
votes
1answer
327 views

pgfplots discarding xtick coordinates

I'm creating a several graphs with pgfplots. The problem I'm coming across is that some graphs do not have a value for the last coordinate as per the example below (and I want to keep the ticks on ...
3
votes
1answer
2k views

Rescaling the colors in a colormap and the axes

I have cerated a file (workfile.dat) at the following format: <x1> >y1> <z> <x1> >y2> <z> <x1> >y3> <z> <x2> >y1> <z> ...
3
votes
1answer
856 views

pgfplots: shadow for markers

I was wondering if it's possible to add shadows to markers within pgfplots. I tried the circular drop shadow option (from TikZ) which unfortunately had no effect at all. I also read that one can ...
3
votes
1answer
402 views

Strange behavior y label in PGFplots

I've noted a strange behavior of PGFplots y label with the following code: \documentclass{report} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ compat = 1.3, no markers, ...
3
votes
1answer
40 views

Horizontal alignment of ytick labels

I am working on a population pyramid. With some sort of hard-code I managed to overlap the ytick-labels of the age in the middle of the graph (but not properly). My question is, how to 1.) suppress ...
3
votes
1answer
42 views

pgfplots external with large dataset (lualatex?)

I have fairly large datasets with densely strucutred data that i cant downsampe much without loosing structure. I use TexMaker on Ubuntu 14.04LTS. I use \usepackage{tikz,pgfplots,pgfplotstable} ...
3
votes
1answer
39 views

Draw axis line on top macro does not work with colorbar

I have a macro from here: Force "axis on top" for plotmarks in pgfplots Which allows me to draw the axis line on top of the markers. However, if I use it in conjunction with a colorbar, it ...
3
votes
1answer
49 views

TeXstudio - get output of pgf externalize in log Window

I like the functionality of TeXstudio to show me errors concerning my latex-code in the Log-window. If I use pgfplots and externalize all externalized pictures are compiled in a separate call. So I ...
3
votes
1answer
38 views

Number format for a node

In the following minimum working example, how do I change number format that is used for the node? For instance, cut off the number after 5 digits. \documentclass{standalone} \usepackage{currfile} ...
3
votes
1answer
45 views

pgfplots bar plot number format

I was just trying to compile some data into a bar chart using pgfplots. Things seem to work apart from the following: The annotation for the bars has low precision, i.e. only 3 decimals, it is shown ...
3
votes
1answer
112 views

pgfplots: Fixing overlapping X axis labels

I am trying to create a time series plot but my X axis labels overlap: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=14cm,compat=newest} \usepgfplotslibrary{dateplot} ...
3
votes
1answer
89 views

Adding manually a grid to a .tikz file generated by matlab2tikz

I asked this question here Stackoverflow Now, I know of the existence of the problem with the conversion with the matlab2tikz script and the inclusion of a grid. GridProb How can I manually add a ...
3
votes
1answer
56 views

How to add one mark to one line in pdfplot

I am attempting to differentiate each line in the graph. Then I try to use marks, however it looks messy. Is there a way to make it looks more tidy? I am open to any suggestion that works. ...
3
votes
1answer
65 views

Changing global settings for makers doesn't work in pgfplots

Often I have documents where I need plots without makers. In this case I set globally a \pgfplotsset{ no markers } However if I have some special plots in the file which require (only) ...
3
votes
1answer
106 views

How to plot the maximum and the minimum

I am interested in drawing the minimum and the maximum of two variables, i.e. min(x,y) or max(x,y). The way I was going about doing it so far was to get the contour plots using gnuplot but my attempts ...
3
votes
1answer
91 views

How to integrate pgfplot inside a pre-existing tikz picture?

I'm trying to put together a pgfplot inside a pre-existing tikz picture. But somehow the axis I create with pfgplot has different units and I'm not sure how to make the two things fit. The code is: ...
3
votes
1answer
102 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 ...
3
votes
1answer
60 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 ...
3
votes
1answer
80 views

pgf stacked bar plot not displayed correctly - wrong intersection with x-axis

I'm trying to generate a bar plot with the code below. As you can see does the bar plot not start at zero, as it should. It starts below zero!!! Can anybody help me? ...
3
votes
1answer
132 views

TeXStudio: Why can't pgfplots open gnuplot output anymore?

Here's the minimum not working example: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
107 views

use absolute coordinate axis in pgfplot automatically

I want pgfplot add a grid with absolute coordinate automatically, for example, below image original pdf is 1.17x1.19in, so I want x is (0,1.17in) and y is (0,1.19in). Now I hardcode it to Nx/Ny, can ...
3
votes
1answer
154 views

How to pass a function defined in sagetex to pgfplots

Is there any way to pass a function defined in sagtex to pgfplots for plotting? See the following example. \documentclass{article} \usepackage{pgfplots} \usepackage{sagetex} \begin{document} ...
3
votes
1answer
144 views

How to set intervals for step-like plot (`const plot`) in pgfplots?

How do I set the precise intervals that pgfplots should consider when performing addplot with the option const plot mark mid? For example: \documentclass{article} \usepackage{pgfplots} ...
3
votes
1answer
205 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} ...
3
votes
1answer
195 views

Labeling only one tick mark but having other tick marks on x-axis

The code provided has pgfplots mark 5 tick marks on the x-axis (at increments of 5 starting at 5). I would like to have only one extra tick mark labeled - the one at 2. \documentclass[10pt]{amsart} ...
3
votes
1answer
203 views

pgfplot: centering the axis above the caption without trimming axes

is there a stable way to center the axis (without the axis label) above a figure caption without trimming the axis with \begin{tikzpicture}[trim axis left, trim axis right] ? Trimming the axis ...
3
votes
1answer
107 views

more precision on the barplot pgfplots

I would like to change the graph to show the 14.047 is less than 15, more decimal precision \documentclass[12pt,a4paper,onecolumn, openright]{report} \usepackage{xcolor} \usepackage{pgfplots} ...
3
votes
1answer
224 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) ...
3
votes
1answer
109 views

pgfplots - How to enlarge a plot when the nodes' coordinates are on/over the edge?

I am creating a groupplot (at least intend to) with a width 4cm for each plot. As I'd like to have the values shown via nodes near coords, this proves problematic because I can't figure out how to ...
3
votes
1answer
155 views

How to have different colormaps for different columns in the same Heatmaps table using pgfplots

I want to make a heatmap using different colors for only two columns in a heatmap. I was able to do it using two different pgfplotstables, i.e, two different heatmaps. But, i wan't to know whether ...
3
votes
1answer
206 views

Location and size of pgf plot axis in a tikzpicture - with tikz positioning library?

This could be a second part to Positioning pgfplots axis in tikzpicture , I guess ; consider the following MWE: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning} ...
3
votes
1answer
199 views

PGF stacked bar graph not drawn correctly

I am having problem with the following code which is supposed to produce a simple stacked graph. \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \usepackage{tikz} \begin{document} ...
3
votes
1answer
137 views

Wrong linear regression computing

I've just started to use pgfplot and I'm actually trying to get the equation from a plot, with the linear regression. However, I'm working in a loglog plot, and the resulting regression equation is ...