{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
1k views

Can Pgfplots extra tick grid line be drawn behind the axis line?

In the example code below, the extra tick at x=0.45 has its gray grid line drawn over the x axis line. At other ticks there is a normal major grid line, and it is ok. I assume the extra tick is not ...
2
votes
2answers
334 views

Ideas for drawing this plot?

I need idea for drawing the following graph. I, obviously, do not expect full code. I hope I can get an idea about the best way to plot this graph. Should I try to draw each rectangle separately? Is ...
5
votes
1answer
1k views

Pgfplots, Legend Color

I have the following problem: I Have a TikZ Picture with two data plots, each with a different color. I want each one to appear in the legend, and I'm using \addlegendentry. The problem is that Latex ...
6
votes
1answer
859 views

pgfplots: Set exponent of scientific number format for nodes near coords

As you can see, my plot currently has node labels with scale factors of both 10^6 and 10^5: My goal is to specify a scale factor of 10^6 for every node label: So my question is: How can I ...
3
votes
1answer
242 views

Odd result in pgfplots when scale and set layers is used together

I have a problem when I use scale and set layers in pgfplots. I have to use set layers because I want that several curves in one plot are above each other (that is not really visible in my example ...
3
votes
1answer
172 views

How can I fix the formatting of my axis using pgfplots so the axis titles aren't on top of the numbers?

How can I offset my ylabel so it doesn't smudge with the numbers? code \begin{figure}[H] \centering \begin{tikzpicture} \begin{axis}[ scale=1.8, xmin=-15,xmax=15,xlabel={Current $mA$}, ...
4
votes
2answers
424 views

Fix append pgfplots style to all pictures breaking plain TikZ compilation

I have the following code in my preamble to align the pgfplots in my document. \pgfplotsset{ every axis/.append style={ scale only axis }, /tikz/every picture/.append style={ ...
3
votes
0answers
715 views

Problem with TikZ area legend [closed]

I am trying to produce an area legend like the following picture. For some reasons, the output of the following code does not produce a single box for each dataset in the legend. ...
3
votes
1answer
761 views

pgfplots won't produce error bars

The following error is thrown when I try to compile the MWE below: Package pgfkeys Error: I do not know the key '/tikz/error' and I am going to ignore it. Perhaps you misspelled it. I'm running ...
4
votes
2answers
1k views

How can I adjust the size of my pgf plot and get rid of these colours

I am having too much trouble trying to get a nice looking plot that takes latex font with gnuplot so I am trying pgfplots again. The only trouble is that I cannot resize the plot, so that it fills ...
9
votes
2answers
2k views

Help with circle and arrows diagram with PGFPLOTS

I'm trying to make a plot similar to this one but I'm having a really hard time. If anyone can help me getting the details, I'll appreciate. I thought I couldn't post questions like this, but as ...
15
votes
1answer
3k views

pgfplots: reduce tick density

I am using matlab2tikz to produce plots in latex. The default tick settings produce very dense ticks, making the axes look ugly. I know that I can use something like /pgfplots/xtick={0, 1, ... 3} ...
3
votes
1answer
456 views

Pgfplots graphics tick label positioning issue with latex->dvi (but not with pdflatex->pdf)

I'm trying to plot an image file in a pdfplots axis. This is a minimal example (the files fig2a.eps and fig2a.png both contain the image that should be plotted): \documentclass{standalone} ...
5
votes
1answer
820 views

How to align plot axis with different tick label widths?

I want to set tick labels of positive numbers to occupy the same space as negative numbers for alignment of 'ylabel'. I want to avoid absolute setting of location since I have other concerns not to do ...
13
votes
2answers
1k views

tikz pgfplots ternary diagram, density map

I am plotting points in a ternary diagram using pgfplots and the ternary axis environment. Each point does posses a 4th value (besides the 3 that are the coordinates). At the moment I am stating ...
3
votes
1answer
145 views

increase length of a \node option and change its color

I would like to increase the vertical length of a node in a way that it can also stretch outside of my image. Moreover, I need to choose different color for each line. \documentclass{article} ...
6
votes
1answer
712 views

Custom axis marks in double logarithmic plot

I'm getting quite frustrated with my lack of pgfplot understanding and was hoping somebody could help me figure out how to get more readily readable/understandable x axis tick marks. I have the ...
7
votes
1answer
330 views

How to plot a graph with separate scale reference lines?

I have searched through different plots generated by pgfplots and could not find my desired style as below: I know how to hide axes, but would like to know does PGFplots have an option to ...
12
votes
1answer
1k views

How to jam the axis of a pgfplots plot?

I need to have some kind of jump on the axis of the plot in pgfplots package. Something similar to the following figure where some part of the scales are jammed. It would be interesting to have ...
5
votes
1answer
912 views

how to create an histogram with a string label using pgfplots?

Dear i try to generate an histogram / barplot result.csv: overlap,hit,organism 100,274,Unknowns 100,228,Coccomyxa subellipsoidea 100,11,Eukaryota -500,153,Unknowns -500,145,Coccomyxa subellipsoidea ...
1
vote
1answer
560 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. ...
2
votes
1answer
199 views

ticks disappearing for diverging (out of range) plots

my xticks disappear for some plots even though I explicitly ask for them. Here is my MWE. The function goes to -infinity at the right border of the interval. \documentclass{article} ...
7
votes
2answers
680 views

Plotting a reciprocal of a sine function in tikz + pgfplots

This is my code at the moment: % Rest of document omitted brevity... \subsection*{f(x) = cosec(x)} \begin{tikzpicture} \begin{axis}[every axis plot post/.append style={ mark=none, domain=0:360, ...
2
votes
1answer
3k views

How to draw a plot from .xls file in pgfplot?

I want to read .xls format file in pgfplot to draw a graph. I couldn't find how to do that. Is it possible to do that? I have attached a small .xls file here for which I want to compute plot. ...
5
votes
1answer
2k views

Log axis in pgfplots

When I add the log ticks with fixed point option, pgfplots ignores the x-axis range instead of just affecting the y-axis. without log ticks with fixed point with log ticks with fixed point ...
4
votes
1answer
686 views

Multi axis plot problem with appearance

I have a problem with the appearance of a mutli axis plot... Currently I have the following: However I do not want the arrow in the right y-axis but from the documentation I read that the * in the ...
5
votes
1answer
674 views

Too many contour labels in contour plots

I am trying to create a contour plot with labels in the contour lines. The data is imported from Octave, and stored in a file called data.dat. It contains many contour lines, so that manual ...
12
votes
1answer
359 views

Having tick labels like 1, 10, 10^2, 10^3,

I would like to have y tick labels like 1, 10, 10^2, 10^3, ... So far I found found to display them either 1, 10, 100, 1000, ... or with exponents. Is this possible with pgfplots?
10
votes
1answer
2k views

How to read value from table, assign to variable and use it in x expr=\thisrow{}

How can I read the first value from the first column of a table, assign it to a variable and the use it in some math expression with x expr=\thisrow{}? The code would be something like this, but in ...
4
votes
1answer
6k views

Dashed Line with marker when adding plot from table

In the pgfplot, I would like to have a line plot from a table which is read from a .csv file. I would like to have a line which is dashed and has a marker. I put the code like this - \addplot ...
11
votes
2answers
289 views

Can I rotate a marker with a scatter source?

I'd like to be able to use pgfplots to show a skier going down a ski slope. Here is what I have done so far. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \makeatletter ...
3
votes
1answer
252 views

How to make the legend border tighter?

I am trying to make the legend border tighter. What is the \begin{axis}[legend style={...}] property to adjust the legend border (both width and height of the border)? \documentclass{article} ...
13
votes
1answer
3k views

pgfplots - Placing Nodes on x Coordinates of a Plot

I want to plot some graphs in pgfplots and want to place nodes on the exact same x coordinate of the plot. The position of the note has to be set in x direction but free in y direction. Here is one ...
9
votes
1answer
443 views

Sum up rows from different data files

I've a certain amount of inputfiles (.txt) for the final definition of the y-data of my axis environment. The x-data come from a different file. The goal is to sum up each row of the input files ...
5
votes
1answer
1k views

How can I adjust the column width of legend in PGFplots?

I would like to adjust the width of the legend lines (images) in PGFplots. Since legend is a TikZ matrix, I can adjust the separation between lines, space between text and lines by changing the matrix ...
11
votes
2answers
522 views

Visualize data on a variable-radius graph/network

I am trying to visualize the output from a simulation model I have been working with. The simulation finds the steady-state solution to a system of differential equations on a variable-radius (and ...
6
votes
2answers
562 views

Plot x=3 in PGFPlots

I just started to use pgfplots and I'm trying to plot the line x=3 (a line parallel to the y axis where x is 3). I've tried to find an answer on the net, but all the examples always show how to ploy ...
15
votes
1answer
2k views

How to make the tick thickness as the axis line?

I am trying to make the thickness of the ticks equal to the axis line thickness. That is what I have so far: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.5} ...
7
votes
2answers
6k views

How to save a figure produced by tikz save/export as JPG/PNG file

I have created various plots using pgfplots package for my thesis. Now I would export them in jpg or png format. Does it exist a way to achieve this porpouse?
4
votes
1answer
2k views

pgfplot contour plot with both x-axes and y-axes ticks labels

Here is an MWE for a contour plot. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.7} \begin{document} \begin{tikzpicture} \begin{axis}[ % title = {$x ...
6
votes
2answers
604 views

3d surface plot with (-1, -1, 0) coordinates

Here is my code for 3d surface plot with pgfplots. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel = ...
7
votes
1answer
6k views

How to adjust label position in PGFplots while maintaining the general \pgfplotsset setting?

I have a few PGF plots in my document where the label positions need to be adjusted separately from other plots. I use the \pgfplotsset in preamble to adjust some general settings applicable to all ...
5
votes
1answer
992 views

Customization of middle axis lines

I'm trying to customize a bit the axis lines extension of pgfplots. Here is my code and what I get now. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{% compat = 1.7, every non ...
21
votes
1answer
12k views

Change the appearance of grids in pgfplots

I am asking if there is a command in the pgfplots package that changes the appearance of the grid in terms of kind of the lines. What I mean is how to change the kind of lines. I have read the ...
6
votes
1answer
532 views

Pgfplots: Problem in adding shape to legend

I am trying to put two boxes in blue and red beside the legend text in a histogram plot. I have tried several things including the one in this link. Unfortunately, the code in the link does not ...
5
votes
1answer
697 views

TikZ: Problem in overlaying a bar plot to existing bar plot

I have created a normalized histogram by the following code using tikzpicture \begin{tikzpicture} \begin{axis}[ width=\figurewidth, height=\figureheight, scale only axis, xmode=log, ...
1
vote
0answers
291 views

scaled y ticks=false don´t work together with loglogaxis? [closed]

I´ll like to remove the multiplier on the y axis. My wish is to get somethings like, 0.001, not 1.10^-3. Can somebody help me please ...
7
votes
1answer
2k views

tikzpicture in minipage

Can I set the exact width to a tikzpicture? I thought so, with "width", but I tried this: \colorbox{gray}{ \begin{minipage}{.33\textwidth} adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk ...
14
votes
1answer
11k views

pgfplots: Selectively reducing marker size in the legend

I have a plot created using pgfplots in which I have included a legend. However, I find that the marker sizes in the legend are the same size as the markers used in the main plot. I think this is a ...
8
votes
0answers
324 views

Help on adjusting histogram plot created by TikZ [duplicate]

I am trying to create a tikzpicture similar to what I have made in MATLAB. MATLAB gives me the following result after running histogram: myhistnorm = [ 0.1231 0 0 0 0 0 0 0.0001 0.0001 ...