{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

5
votes
1answer
165 views

PGFPlots: How to shift the values read from the file

I have a plot that reads the values from a file. Now I want to shift the values in the file. Is it possible with builtin methods of PGFPlots? I want something like the shift function: ...
5
votes
2answers
294 views

Using tikz or something similar for generating general graphs? [duplicate]

What I'm looking for is graphs that can be generated very easily? for eg just an x-y graph with some linear function or quadratic/cubic/quartic to be plotted? a general case nothing specific without ...
8
votes
1answer
281 views

Fitting on log log axis

I try to fit data which I plotted on a double logarithmic scale. I use LaTeX and gnuplot. [It works with pdfLaTeX with adding the additional argument "--enable-write18" and directing the path of ...
11
votes
1answer
290 views

Problem with legend in pgfplots

I want to make plot with fill area. I try this code \documentclass[a4paper,12pt]{report} \usepackage{pgfplots} \definecolor{plotmain}{HTML}{97bbcd} \pgfplotsset{every axis legend/.append ...
5
votes
2answers
203 views

Labeling node values on the axes

I want to draw some curves and some special coordinates on the curves, then label the nodes on the axes. So far I have done it manually like this (it's a diagram for the Markowitz risk premium in case ...
4
votes
1answer
588 views

pgfplots: custom axis arrow head [duplicate]

I'm using this answer to make a bigger arrow head. I would like to use this new arrow head as my default arrow head (both in pgfplots axis and in tikz pictures). Here is a MWE: ...
6
votes
1answer
606 views

Inverting a colormap in pgfplots

I am trying to obtain an inverted version of a given colormap to use in the colorbar of a plot. The code below achieves this specifically for the blackwhite colormap. However, I was looking for a ...
4
votes
1answer
239 views

How to make a bar diagram with several “levels”

I just started using TikZ and I am trying to make the following bar diagram: My main problem is to define bar type in which I could put the following arguments (for every bar separately!): (1) the ...
5
votes
1answer
123 views

How to put data labels next to the text labels in a bar plot?

I am trying to reproduce using PGFPlots the bottom-most graph found in this link: The following is my best attempt: \documentclass{standalone} \usepackage{pgfplots} \begin{document} ...
8
votes
1answer
299 views

Can I make coordinate plot more smooth?

I am currently trying to make an image for Topology. Although it doesn't really matter for the content, I think a smooth neighborhood looks nicer. What I currently have ...
1
vote
1answer
282 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
0answers
201 views

bar width not recognized in group plot

I am trying to put four bar charts within one groupplot. My file is \documentclass[tikz,border=3pt]{standalone} \usepackage{xcolor} \usepackage{pgfplots,pgfplotstable} \usepgfplotslibrary{groupplots} ...
5
votes
1answer
149 views

Kiviat Diagram with scale always aligned to first axis

I'm using Kiviat Diagram to draw graphs, sample code for same is mentioned below: \begin{center} \psframebox*[fillcolor=white]{ \begin{pspicture}(-6,-5)(5,5) \psset{unit=1.2} ...
3
votes
1answer
132 views

PGFPlots: Thick line goes outside drawn y-range

What is the best way to avoid thick lines in PGFPlots from going outside the drawn y-range? For example, near the maximum in \documentclass{article} \usepackage{pgfplots} \begin{document} ...
7
votes
1answer
187 views

What is wrong with this code to plot '(y^2)/2-cos(x)'?

I want to contour plot the curves (y^2)/2-cos(x)=c with the following code, but there are only straight line in the output figure. What's wrong? Any help or suggestions will be appreciated! ...
9
votes
1answer
474 views

How to adapt the color of a label using pgfplots

I created this style that shifts the labels and put them on the bottom of the ybars. However, I have a problem with the bars that have too short length (for example, see the 8.7 and 5.1 in the ...
6
votes
1answer
156 views

Problems with passing values through nested levels

Inspired by a comment to another question, I'm trying to generalise some code to draw coloured in rectangles upon the graph of a function. The routine \findmax, given an x-value and a function, ...
1
vote
0answers
79 views

How to set a shaded area around 2d plot curve on a pgfplots figure? [duplicate]

I plotted a 2d figure of a curve but I also want to show variance of the value with a shaded area around the curve line. How can I do it in pgfplots? Here is my current plot.
5
votes
1answer
266 views

swap x and y axis on data generated plot

I have generated a plot using a long list of plot coordinates (x,y). I would like to plot the data as (y,x) with y on the horizontal axis and x on the vertical axis. Is there any way to do that? I ...
3
votes
1answer
180 views

pgfplots - how to draw seconds from csv in hours:minute format?

I have data in a .csv file with seconds as x values. I'd like to tick the x axis in hours:minute formate e.g.: 0:00 , 0:30 , 1:00 , 1:30 ... How do I have to redefine the interpretation of values to ...
5
votes
1answer
542 views

Draw line between two plots

I am trying to draw a line between points of two plots as shown in the picture (the blue line) but without luck. It is with tikzpicture and pgfplots. Similar to: \begin{tikzpicture} \begin{axis} ...
4
votes
1answer
161 views

Get this error when I run my pgfplots

I got a problem with my pgfcodes. I get this error: ! Package pgfplots Error: Sorry, pgfplots expects stacked plots to have exactly the same number of coordinates. Unfortunately, I encountered ...
10
votes
2answers
700 views

plot 3d graphs of functions defined implicitly

How can I plot 3d graphs of functions defined implicitly (quadratic forms, for Linear Algebra course notes -- I'd like to include lots of examples)? As far as I can see it is not possible with ...
16
votes
5answers
612 views

Placing coloured rectangles on a plot, using points from the plot - Riemann Sums

October 31st Note: Below is the original question, but after some feedback I have progressed somewhat and posted an answer to demonstrate what I've learnt since. My answer presents an encapsulated ...
1
vote
0answers
91 views

How can one reduce the size of ternary graphs when they are many on a page?

I need help on how I can reduce the magnification of my ternary plots so that the four graphs can be accommodated on the page.At present what I have is a little more than what a page can accommodate ...
5
votes
3answers
210 views

shading Plots with other format

I have the following data: Year upper lower 2007 3.2 -.81 2008 2.0 -.29 2009 1.8 -.95 2010 -.5 -3.9 2011 -2. -7.3 And I'd like ...
0
votes
0answers
72 views

Dimension too large in TikZ [duplicate]

I have some problems with drawing plots in TikZ. I use GeoGebra to build two curves and then export code into TikZ. So I get following: \definecolor{ffffqq}{rgb}{1,1,0} ...
14
votes
4answers
511 views

How to plot blurred curves with PGFPlots?

I'm trying to replicate the following plot with PGFPlots: In this answer, the author plays with opacity when drawing overlapping ellipses. Is it possible to use similar code with arbitrary curves? ...
3
votes
0answers
100 views

Nested symbolic x coords in bar chart

any ideas on how to create something like this in latex? the image is of a basic grouped plot (using pgfplots) but with a nested x axis group (the numbers in red) that I've added using an image ...
3
votes
2answers
241 views

Plot from scratch (without explicit data)

I'm trying to draw a plot which I've been given in a scan: What is the correct way to plot a custom shaped curve --- a freehand tool counterpart. I used quick curve but it's hard to tell extremum ...
14
votes
1answer
1k views

Dos and Don'ts of \pgfplotsset{compat=newest}

Question I just upgraded to 1.9. Christian recommends against the \pgfplotsset{compat=newest}, but that leaves one having to come back and update compat=x.y in one's projects, several times, over a ...
4
votes
1answer
332 views

Positioning various types of node over a 3D Plot

Now I've got my curves in 3D behaving the way I want, I would like to add text nodes and vector arrows and so on. Below is an MWE of my basic diagram and the first labelled arrow I've added. That was ...
4
votes
1answer
220 views

Controlling Orientation in 3D PGF Plots

Question Why does x-axis pointing right and y-axis pointing into the page appear to be the default? When I found the page in the following link, the answer coincidentally presented the axes exactly ...
0
votes
0answers
22 views

Bar Graph with Scale Break [duplicate]

I am new to PFGPlots and have been trying my best to create bar-graphs with error bars AND scale/axis break, but this is proving difficult please help me. Currently the Bar-graph C has too high of a ...
5
votes
2answers
148 views

Unwanted Line Drawn Between Ends of Curves in 3D

Okay, this was about one of the technical pitfalls and how to avoid it, which was solved quite easily by adding samples y=0 as recommended by Francis. Initial Question The following does two turns ...
1
vote
1answer
125 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 ...
4
votes
1answer
386 views

Controlling visibility of 3D axes in \addplot3

In trying to use \addplot3 to draw a paraboloid, the domain of which is [-4, 4] for both x and y, originally, the z-axis was sitting behind the surface. I discovered axis on top, but can you get the ...
4
votes
1answer
95 views

Function with the same domain as data loaded into pgfplots

I am trying to plot data an analyze how well it fits a predicted behaviour. I use pgfplots to plot the data using the command \addplot[color=black,mark=x,only marks] table {data.dat}; I would like to ...
2
votes
1answer
166 views

Adding extra ticks based on sum of ybar stacked

I am trying to add minor yticks on my axis based on the end values of a ybar stacked plot. Here is where I'm at: \documentclass[tikz]{standalone} \usepackage{pgfplotstable} \pgfplotstableread{ Year ...
11
votes
1answer
271 views

Criteria for deciding how best to specify coordinates with tikzpicture with or without pgfplots

Conclusion The original question, as Christian has pointed out, was far too broad and basically a result of being overwhelmed by the size of two main manuals for tikz and pgfplots and how they ...
22
votes
4answers
2k views

Differential Equation direction plot with pgfplots

In earlier thread Jake provided some code whom successfully draws the following differential equations in the range [0; 1] dy/dx=2*x dy/dx=x*sqrt(x) See: How to draw slope fields with all the ...
4
votes
0answers
211 views

Convolve two 2D Gaussians using tikzfading - intensity issues

I would like to visualize the convolution of two 2D Gaussians (or something looking similar). To do this, I declare them in a tikzfadingfrompicture environment. However, to get the desired result and ...
4
votes
1answer
310 views

pgfplots log ticks with fixed point: only for one axis?

I recently learned about the log ticks with fixed point option in pgfplots, which I like very much. However, it seems like if I add it to the options of an axis like so \begin{axis}[% max space ...
5
votes
1answer
874 views

How to draw slope fields with all the possible solution curves in latex

Sorry, I have no code to submit, mostly because I have no idea how to do this. I want to type up my homework (I can do the homework by hand) and I am looking for a simple method that I can use ...
8
votes
1answer
1k views

Problem with a TikZ/Geogebra plot of an exponential function (even if using CVS version definition)

I wanted to graph the function f(x)=(-1+4x^2)*e^2 in a coordinate system. Using "Export Graphics View as pgf/TikZ" in Geogebra I got the following code (here shown after I did some minor changes ...
1
vote
2answers
509 views

3D as 2D plots using Matlab data

I am trying to plot 3d data as 2d (please refer to the attached figure). Is that possible at all in Tex (or Matlab)?(Usually, this is done a s a legend, however, when no colors are allowed, I have to ...
9
votes
1answer
175 views

\pgfmathdeclarefunction and LuaLaTeX

Is it possible to use LuaLaTeX in \pgfmathdeclarefunction? I tried with sinh which seems to work in pgfmathsetmacro but not in \pgfmathparse and pgfplots. How should I declare a pgf function with ...
5
votes
1answer
70 views

Plots with “no marks” have marks in references

I want to plot some functions without marks and reference them in my text - the problem is that in the text there are some random marks and i can't turn them off somehow. \documentclass{article} ...
2
votes
2answers
4k views

Install packages in texworks missing style files

So I am trying to install the pgfplots package in LaTeX on my Windows 7 machine. I usually did this by just running the LaTeX file with \usepackage{pgfplots}, and then the computer asks me if I want ...
5
votes
1answer
305 views

A pgfplots bar chart only shows the first x tick

I have the following code: \begin{figure} \pgfplotsset{ every axis/.append style={font=\tiny}} \centering \begin{tikzpicture} \pgfplotstableread[col sep=comma,header=false]{test.txt}\mydata; ...