{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

6
votes
1answer
505 views

Problem with external graphics and 3D pgfplots

I want to include an external graphics with pgfplots. I tried to follow the instructions of the manual (p45 et seq.) as carefully as possible. But the result is hoorible as hell. Here is the code I ...
8
votes
1answer
1k views

PGFPlots how to add a label “0” to the origin

I am using pgfplots to plot the a function. I have been looking around on the forums, but I could not find a solution. I would like to origin to be indicated as a 0 on the x axis. I would also like ...
1
vote
0answers
30 views

Visualising a matrix as an image, or specifying directly values for segments rather than for vertices [duplicate]

Possible Duplicate: Using pgfplots, how do I arrange my data matrix for a surface plot so that each cell in the matrix is plotted as a square? I'm trying to use pgfplots to visualise a ...
5
votes
1answer
2k views

Change font also on axes in pgfplots

I need to change the font from the standard cnr to Times. I tried \usepackage{times} but that did not change the font of the tick mark numbers on the axes. I pasted the code and an image of the output ...
5
votes
1answer
3k views

pgfplots cannot read table from file

I am trying to plot using pgfplots from a file containing two colums separated by tabs. Tweak Probability 4 0.0065935332 5 0.0006670277 6 0.0002015741 7 6.31090951863062E-005 8 ...
6
votes
1answer
538 views

Question regarding piecewise syntax with pgfplot?

The piece function is defined as following: Here is the code snippet: \pgfmathdeclarefunction{func}{1}{% \pgfmathparse{% (and(#1>=0 , #1<=500) * (300 + #1*(12/10)) +% ...
11
votes
2answers
2k views

Pgfplots axis, option to remove (or ignore) legends

Is there an option in pgfplots at the axis level or a setting of legend style option, that would effectively ignore the subsequent legend entries in the plot? \documentclass{article} ...
5
votes
2answers
643 views

Troubles with number formatting in groupplots

This question has already been answered for axis here but I have troubles to apply the approach to groupplots (please see %additional code in MWE). If I uncomment the %additional code the code is ...
5
votes
1answer
930 views

How can I add color AND a node label to a scatter plot?

I'd like to produce a scatter plot from a data file. The data file could look like this: x y color myvalue 0.5 0.2 1 test 0.2 0.1 2 uniform I'd like to ...
1
vote
0answers
140 views

pgfplots: work on single points in different files [closed]

I have a file containing a lots of data: time, position (3 coordinates), velocity (3 coordinates) and energy. I want to pick only the coordinates at t=50 (50th column of the table) and calculate the ...
8
votes
1answer
1k views

gnuplot calculated curve shifts to the left

The following code samples are borrowed from Test 1 and Test 2. My computer configuration is Windows XP SP.3 Japanese version, MiKTeX 2.9 (already updated), TeXmaker 3.5 or TexStudio 2.4 and ...
4
votes
1answer
2k views

Placing extra x tick on the upper axis

Please consider the following MWE. In addition to the xstick of the bottom x-axis (or primary x-axis) I would like to add a extra tick at the upper x-axis (or secondary x-axis). ...
7
votes
1answer
869 views

weibull plot with arbitrary y axis scale

I want to draw a function in a weibull plot. The x axis is log, the y axis however goes with log(-log(1-y)) (as far as I understood it from this site). The y axis looks similar to a log scale but ...
5
votes
1answer
1k views

groupplots: Managing number of ticks

This question was asked already here but not answered completely. I know of two approaches but they do not apply to my problem: ytick=data: In my example some of the tick labels will overlap. ...
1
vote
1answer
194 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 ...
4
votes
2answers
2k views

How to plot a scatterplot in PGFPlots

I tried to plot a scatterplot from data. I took hint from the site http://pgfplots.sourceforge.net/gallery.html and my tex file is \documentclass[a4paper]{amsart} \usepackage[utf8]{inputenc} ...
3
votes
2answers
3k views

IC50 with curve fit line and value of IC50 appear on the graph using pgfplot

Please help me to make IC50 graph with data as follow S(mM) Activity (%) 0.00080 99 % 0.00800 91 % 0.08000 89 % 0.40000 89 % 0.80000 79 % 1.60000 61 % 4.00000 39 % 8.00000 25 % 80.00000 4 % ...
6
votes
1answer
291 views

pgfplots, using sprintf in clickable library

I am using pgfplots in combination with the clickable library. Here's an example \documentclass{article} \usepackage[latin1]{inputenc} % important packages \usepackage{pgfplots} ...
7
votes
1answer
911 views

pgf math error, division by zero

I have a valid gnuplot function (plots fine in gnuplot), with pgfplots fails to use: \documentclass{article} \usepackage{graphicx} \usepackage{pgfplots} \begin{document} \begin{figure}[H] ...
6
votes
1answer
401 views

pgfplots filling under spline

Is there any way to fill the area under a spline? In the example below, removing mesh from the addplot options closes the cycle as expected with by joining the first and last coordinate by a straight ...
9
votes
2answers
2k views

Change the color of ticks in pgfplots

How do I set the color of the tick marks (major and minor) in pgfplots? It seems like a very basic question, but I cannot find it in the instructions. I would like to have black tick marks instead of ...
11
votes
1answer
806 views

Why does pgfplots package cause tikz layer to disappear?

I wish to include a pgf-generated line plot and a tikz-generated graphical model in the same document. However, the presence of the pgfplots package (needed for the axis environment) seems to turn one ...
8
votes
1answer
314 views

Pgfplots: link different single-points graphs

I created the following image: whit the following code: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{% compat=newest,% /pgf/number format/use comma,% ...
12
votes
2answers
979 views

Not recompile unchanged pgfplots graph

I'm writing a document with something like 30 graphs with a lot of points in each. The graphs are almost ok and I don't need to change them for now. I'm improving the text, so I need to recompile ...
3
votes
0answers
263 views

ytick pos=right doesn't work [closed]

This is my code: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.3} \begin{document} \begin{tikzpicture} \begin{axis}[xticklabel pos=right, ...
0
votes
1answer
112 views

Switch from in-code data table to external file in macro

I have used the very nice grouping macro described here: How can I mix an "ybar" and an "ybar stacked" with pgfplots? I would like to be able to use it with data that I have read ...
4
votes
1answer
230 views

On how double precision numbers are encoded in a pdf file

Imagine the following tikz/pgfplots code: % compile as: lualatex --jobname=figname-f1 figname.tex \documentclass[10pt]{book} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.6} ...
10
votes
3answers
848 views

pgfplots plots function not correct

This code \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis} \addplot [domain=15:30, samples=1000] ...
6
votes
1answer
574 views

pgfplots: how to set default number of samples?

For most of the functions I have to plot with \addplot of pgfplots, I have to set [samples=200] to make them look smooth enough. I was wondering if there is some option to set the default sample ...
5
votes
1answer
936 views

Define different ranges for different data sets when plotting from a file or table

I would like to make a plot of several data sets that are stored in a text file (tab-separated). Is there a way of defining the x-range for which some (not all) of the data sets should be plotted? I ...
6
votes
1answer
2k views

How do I draw a scatterplot with a function plot?

I am trying to plot a scatterplot with a fit line that I have already calculated, but I am having trouble getting them to line up and use the same scale. I tried doing it with ...
18
votes
1answer
7k views

How do I make a TikZ/pgfplots scatter plot without lines between points

I am attempting to make a scatter plot from a table of data. I seem to have almost succeeded, but there are lines between the points. I do not want this to happen, but I can't figure out how to remove ...
8
votes
1answer
1k views

Pgfplots: title covers scientific notation

I have a problem with pgfplots. As you can see by compiling my MWE, the title of the plot covers the scientific notation of the y axis. Is there any way to fix that (move the title or the scientific ...
29
votes
5answers
3k views

How to draw the region of inequality?

Everyone, I would like to draw the region \begin{align*} x_1 + x_2 &\ge 3 \\ 2x_1 - x_2 &\le 5 \\ -x_1 + 2x_2 &\le 3 \end{align*} Here is my code to draw the region of inequality: ...
14
votes
1answer
714 views

How to plot integral as summation, as pictured?

I'm new to TikZ and pgfplots but would like to know how to plot the square as well as how to plot the arrows + delta x as well as arrow + delta A: I'd be most grateful if some of you had some ...
3
votes
2answers
125 views

What is an appropriate way of plotting a number as a function of year?

I am trying to plot a certain number as a function of year for different entities. In this example, it is the number of missions to the Moon for different agencies per year. What I have come up with ...
8
votes
1answer
2k views

Pgfplots and arithmetic with data files

I have a file (table) with a lot of columns. In the first column I have time and in the nexus three columns that represent vector components. Now I want to plot vector magnitude in function of time. ...
8
votes
1answer
325 views

Is it possible to combine cases with pgfplots legend?

I would like to print a function and add a legend which makes use of cases. The current code is: \documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} ...
3
votes
1answer
1k views

Problem with subfig and pgfplots' graphs

I have a problem with the subfigenvironment. My two graphs created with pgfplots are too large to stay together. How can I fix that? % Graphique \begin{figure} \centering \subfloat[]{$\tau = ...
3
votes
1answer
115 views

problem with plot

I am having a problem with the following code for generating a plot. I don't know why the first group (Yago) does not include the first entry (the blue one for Sys1) and the second group does not ...
12
votes
2answers
2k views

Is it possible to multiply the x coordinates of a plot by a certain factor using pgfplots

I have a pgf plot. Now the scale on the x-axis is at the moment frequency, hz, but it should be rad/s to save myself time exporting the file again is it possible to multiply the x-coordinate of every ...
10
votes
1answer
647 views

Align ylabels of grouped plots at a common line

I use the groupplots library of pgfplots to stack several plots above each other. The y tick label of the two plots have different width as the y axes of the plots are in different scales. As long as ...
2
votes
2answers
522 views

Pgfplot Automation tool

Are there any good graphical software that I can use to draw diagrams/graphs and export them as pgfplot code? For example, I want to create an histogram so I drag an histogram icon from a menu to the ...
14
votes
2answers
8k views

Increasing TeX's main memory

I have a plot with a lot of measurement datapoints. I exported this plot from Matlab2tikz. When I wanted to compile this, it said that the memory was exceeded. Now I found this, How to expand TeX's ...
14
votes
2answers
747 views

Naming the nodes of `nodes near coords` for later use

I would like to use pgfplots command nodes near coords to get a list of named node ((no1), (no2), (no3) etc.) that I can use afterwards to draw some paths that I fail to construct with pgfplots only. ...
5
votes
0answers
458 views

Trying to make an automatic histogram (in pgfplots?) [closed]

How can I convert the automatic table generated by the macro, to an automatic histogram? Is the best way do it using pgfplots? \documentclass{article} \RequirePackage{ifthen} ...
2
votes
1answer
133 views

How can I shift ymin to zero when values are near to zero?

How can I shift ymin to zero when values are near to zero? I also try ymin=0 command but it does not work. \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[ ybar, ymax=4, ...
4
votes
1answer
720 views

Color-bar - surf plot

I have a surf plot as shown below. However, the markings on the color-bar are in steps of 0.05. Instead, I want the markings to be in steps of 0.25. How should I go about doing this? Below is the ...
5
votes
2answers
2k views

Annotate Plots in TikZ/PGFplots

I have the following piece of code in my tex file. \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=2] \tikzstyle{every node}=[font=\scriptsize] ...
5
votes
1answer
681 views

Arrow heads as plot marks

I would like to draw a plot and put arrow heads pointing in the direction of the plot instead of marks. My first idea was to use the quiver option from pgfplots by duplicating and stagering the ...