{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
127 views

How can I prevent a node from being cropped in an axis environment? [closed]

I would like to put labels on the left side of a y-axis, but the text gets cropped. How can I prevent this? (Also, the entries are looking awful, so any ideas how to make it looking better are ...
8
votes
1answer
577 views

ellipse intersecting a circle

I am trying to draw an ellipse which intersects the sphere of influence, that is, the dashed circle around the moon. The ellipse needs to pass through (-170.864:.7cm) location along the v0 vector and ...
2
votes
2answers
2k views

barchart in pgfplots looks really bad

Problems: The bar value "90" is written over a black line, almost impossible to read The value "58" is written over an x tick, hard to ready Bar spacing is bad. There is too much space between the ...
0
votes
1answer
212 views

Group labels in pgfplots or finding cm fonts for windows

I'd like to put a second xlabel on a grouped bar graph using TiKz but can't seem to work it out. So I have found this cm superfonts package: http://ctan.org/pkg/cm-super. Or I can download cm fonts ...
10
votes
3answers
4k views

Smooth curve through points with pgfplots

I know that one can get smooth point connections with option smooth to \addplot that takes the previous and the next point into account, but this still connects all the points. How can I draw a ...
5
votes
1answer
841 views

Small x axis range in pgfplots

I try to plot data in pgfplots. My data file has 1001 points in a range (x axis) from 2499999500 to 2500000500, so I have steps of 1. I get the message “Package pgfplots Warning: Axis range for axis x ...
2
votes
0answers
113 views

Plot doesn't care about axis setting [closed]

I have a Pgfplot and for some reason it does not care about my y-axis settings... I have set ymax to 15 but for some reason it only goes up to ymax is 14 or something... Can anyone explain why? And ...
6
votes
0answers
397 views

Using pgfplots and gnuplot and compiling with output-directory

I would like to use the pgfplots package along with gnuplot. However, I cannot get this to work if I compile using the -output-directory option. For example, if I have the following MWE: ...
4
votes
1answer
901 views

PGFPlots error “Dimension too large” when plotting .csv data

I did search on here for a solution and I did read the manual, but i couldn't find an answer (or at least one that I understood). I am plotting some data in a .csv file and for some reason when the x ...
7
votes
1answer
463 views

Postprocessing pgfplotstable results using siunitx

I am trying to use the \num command from siunitx inside a table made with pgfplotstable, because I need the format given by siunitx with \sisetup{scientific-notation = true} and all the advantages of ...
2
votes
1answer
542 views

Intersecting planes not shown correctly with TikZ

I made a plot in MATLAB of a deformed and an undeformed model. I converted the figure to TikZ using matlab2tikz and added it to my .tex file. I then noticed that the two configurations, which are ...
1
vote
1answer
162 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. ...
3
votes
1answer
700 views

Drawing a hyperbolic trajectory

In Drawing the Celestial Sphere with Tikz Package, they use pspicture. Is there a way to use pspicture inside of tikz? I want to have a hyberbola pass by the Earth with a periapsis of 500km (scaled ...
8
votes
2answers
687 views

half of a hyperbola

Only top portion of half my hyperbola is coming in correctly. The other half is doing something strange: \documentclass{article} \usepackage{tikz, pgf} \begin{document} \begin{center} ...
11
votes
1answer
802 views

Setting axis line offset?

I was wondering if it was possible to easily detach the axis lines from each other. From this piece of code, \begin{tikzpicture} \begin{axis}[% xmin=-6.3, xmax=6.3, ymin=-2.3, ...
3
votes
0answers
198 views

pgfplots — Patterns are not displaying correctly in PDF version 1.4 [closed]

I am using this method to plot a pattern in-between two curves. If I save the file as PDF version 1.5 everything looks great. Unfortunately the journal that I am submitting the paper to requires PDF ...
4
votes
1answer
195 views

Good-looking luminosity function plot

I'm trying to make a good-looking photopic luminosity function plot. So I want to make colored plot, but its colormap should depend on X values. Is it possible with pgfplots? I'll also appreciate any ...
2
votes
1answer
122 views

Use markers as clip path

I want to plot a line, where the markers knock out a piece of the line instead of being displayed (it would be useful if there was a way to leave a bit of space around a marker, too). Drawing the ...
2
votes
1answer
281 views

How can I get the grid done correctly?

I'm trying to put the grid in my graphic, and I'm getting this problem below. The grid style must be help lines, and dashed, this I know how to do, but the problem remains in put the grid correctly. ...
3
votes
1answer
156 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. ...
4
votes
1answer
800 views

pgfplots and linear regression with semilogyaxis

I would like to add a linear regression line to my plot. The MWE is: \begin{document} \pgfplotstableread{ Year ICumCDP 2008 3.73E-07 2009 3.35E-07 2010 2.01E-07 2011 3.88E-07 2012 1.36E-06 ...
5
votes
1answer
480 views

How to plot small function values in pgfplots?

I am trying to visualize two functions in pgfplots and I can't get my main message across that both end at the same point. How can I change this behaviour, preferably without additional external ...
2
votes
1answer
672 views

Need help in drawing the following Stacked Bar Graph

I want your help in drawing the following figure. I think it is called as stacked bar graph.
6
votes
1answer
115 views

How to take off the marks of a graphic made with a CSV file

I'm importing a CSV file and I want to take off the marks of the graphic,how can I do this? \documentclass{minimal} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} %\usepackage{filecontents}% ...
6
votes
1answer
473 views

How to use only mathematical input in the first column with pgfplotstable

I can use a mix of text and mathematical input in the first column of a table generated with pgfplots with no problem, and also mathematical input in, e.g. the last column, as this mwe shows: ...
5
votes
1answer
408 views

Node only partially rendered near edge of plot

I'm trying to draw a relatively simple chart of a number line, and when one of the nodes is too close to the edge of the plot, it gets cut off. The code: \documentclass{article} \usepackage{natbib} ...
11
votes
2answers
13k views

PGFPlots: Logarithmic axes and scaling

I'm trying to plot some data where the X axis is logarithmic. The data runs from ~30 microseconds up to 10 milliseconds. It looks much cleaner to have the x-ticks looking like {0.1 ms, 1 ms, 10 ms} ...
5
votes
1answer
887 views

Plotting a 2D gaussian sample

Can you please help me with making a 2D Guassian sample with specified means and variances? I only know how to make a guassian curve :D \documentclass{article} \usepackage{paralist,pst-func, ...
2
votes
1answer
582 views

PGFPlots slow down compilation when plotting from external files

I am writing a report containing multiple plots of spectroscopic data by way of PGFplots which is fetching data from external files. It used to do the work, and after a few minutes of compilation it ...
9
votes
1answer
2k views

Why does pgfplots plot functions only until x = 5 and y = 5?

Why does pgfplots plot functions only until x = 5 and y = 5, but not any further? \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} %%%< \usepackage[active,tightpage]{preview} ...
10
votes
1answer
1k views

Contour partially hidden by a surface in pgfplots

Thank's to SE (and particularly these two questions: Draw a bivariate normal distribution in TikZ and How to fix a contour plot at top of a 3D box), I've been able to draw what I was looking for with ...
5
votes
1answer
336 views

Plot the \coordindex in alphabetic order

I need to replace the index numbers in the plot by alphabetic sequence. For example, on the following graph instead of 0,1,2,..., I want to see a,b,c,... \documentclass{standalone} % This file is an ...
7
votes
1answer
8k views

How to remove the frame of a plot in tikz but keep the axes?

I want to have a plot in tikz, with the horizantal an vertical directed axes, without numbering and without frame. Right now my code is as follows: \documentclass{article} ...
5
votes
1answer
1k views

Bar charts: Change the vertical order of different plots and corresponding legend entries

I want to compare percentages of two different years using horizontal bar charts. The values for the 2 years (1996 and 2011) are given via a pgfplots table. I want the 1996 values to be shown in top ...
5
votes
1answer
549 views

Disappearing plot (All values has been filtered away)

I am trying to get the following plot to work \documentclass[a4paper,10pt]{standalone} \usepackage{pgfplots,tikz} \pgfplotsset{compat=1.6} \begin{document} \begin{tikzpicture} \begin{semilogyaxis}[% ...
3
votes
1answer
1k 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 ...
5
votes
2answers
890 views

TikZ Function Number Too Big

I want to draw two beta distributions comparing a prior and posterior distribution but it seems that the coefficients are too large for LaTeX? How do I fix it without changing the function? It has a ...
13
votes
5answers
1k views

Create image from statistical data automatically

I am looking for a way to automatically create images like the one below: There is no MWE because all I have, for now, is this image (created, I believe, by SPSS, but I have nothing to do with that ...
3
votes
1answer
238 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
167 views

How to fill a rectangle with two corners on the function

I would like to be able to apply the same thing in the following figure for any function: Right now my code is like this(which is an edited version of some post here in Tex.sx): Wich only fills ...
4
votes
2answers
1k views

How to align two plots horizontally

I want to align these two plots horizontally: \begin{tikzpicture} \begin{axis}[ xmin=1995, xmax=2010, ymode=log, xtick={1975,1980,...,2015}, ...
5
votes
1answer
790 views

How to autoscale a horizontal barchart (pgfplots)

I need to export statistics from a database into PDF files, with a program. The database contains several tests and they need to be displayed as barcharts. Here is an example: The problem is clear: ...
4
votes
1answer
278 views

Plotting the frequency bandwidth

I do not have almost any experience with pgfplot and I am having some problems with something which seemed really easy. What I want to do is filling the area between a function and two vertical ...
10
votes
1answer
305 views

How to avoid connecting discontinuities in graphs when plotting data?

I would like to plot a graph that has a discontinuity in the sense that it jumps from 180 degree to -180 degree at one point. Unfortunately, the points at 180 and -180 get connected. See the figures ...
2
votes
0answers
186 views

Stacked bargraph nodes near coords too bunched up vertically tikz [duplicate]

How do I center the coordinates in their bars vertically? This shows horizontally in ybar \documentclass[tikz,border=12pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
4
votes
1answer
557 views

line legend for mesh plots

I am doing a group plot of related curves. Since they are related by a parameter, I want to color them according to (a function of) that parameter. For that purpose, I used the mesh option, and then ...
2
votes
1answer
772 views

Change axis number format for external tikz file

I'm using \input{filename.tikz} to include .tikz graphs created by matlab2tikz in my LaTeX document. As shown in a comment on this question it is possible to change the plot marker size when the ...
4
votes
1answer
655 views

Grid lines in top-view surface plot

I'm almost satisfied with my graphs, only grid lines are missing. What I'm basically doing is a sort of density plot / color plot by letting pgfplots generate a surface and viewing it from the top: ...
6
votes
1answer
778 views

Scale markers in external Tikz file

I use external .tikz files to include graphics in my LaTeX document. These .tikz files are generated by matlab2tikz. The scatter plots that come out though have very small markers. I want to scale ...
5
votes
1answer
2k views

pgfplots - how to create a horizontal line plot in a bar chart with symbolic x axis labels

I was wondering if there was a way to get the line plots "Unseamed" and "Requirement" to span the whole width of the graph not just from the centre points of the first and last x axis labels. Is there ...