{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

11
votes
1answer
835 views

Plot magnification using sub-plot within a plot!

How can I produce such kind of zooming shown in the figure? Here the selected portion is plotted again with new axis displaying more details than just magnifying the portion. One solution is to ...
9
votes
1answer
1k views

plotting two time series with bounds

I've two times series (y_h, y_f) with a lower and upper bound (confidence interval). I'd like to plot all of them on the same picture. I've succeeded in plotting y_h with upper and lower bounds, but i ...
4
votes
1answer
974 views

How do I change the color of one axis in pgfplots?

I know how to change the color for all axis in pgfplots: \begin{axis}[blue] \end{axis} This makes all four edges of the plot blue. Another example is there: PGFPlots: Change the color of axis lines ...
11
votes
1answer
4k views

Add grid only on y-axis (pgfplots)

I would like to add only a grid on the y-axis. Here is my MWE: \documentclass{scrreprt} \usepackage{tikz, pgfplots} \begin{document} \begin{tikzpicture} \begin{semilogyaxis}[ /pgf/number ...
2
votes
0answers
506 views

How legend-entry can be possible in Tikz [closed]

I want to use legend-entry for straight line & dotted line. \begin{figure}[htp] {\small \centering \begin{tikzpicture} \draw [color=black, fill=gray!50] ( 0.2 , 1.975 )-- ( 0.3 , 2.05 )-- ( 0.4 ...
12
votes
3answers
1k views

pgfplots - Add offset to pins

I'm trying to make a bar plot for an optimization parameter in quantum physics. To be more informative, the graph should display the values of these parameters above the bars. So far I did ...
3
votes
1answer
219 views

Shift y labels, stop y labels being dropped

I have a const plot with intervals on the y-axis. I'd like my y labels to be centered in each bar, as it would be if this were an xbar interval graph. Also, and more importantly, I'd like more ...
11
votes
1answer
2k views

How do you increase the number of points pgfplots uses?

My plots look blocky. Is it possible to increase the number of points PGFplots uses when plotting a graph from a formula?
2
votes
0answers
433 views

Contour plot: ignored columns, wrong color-assignment, 1D-interpolation [closed]

This forum has often been of a great help for me, but i never posted myself. So please excuse me, if i won't stick to every formality here perfectly. I will do my best. I hope it's ok that i have 3 ...
10
votes
1answer
2k views

Change grid line dash pattern such that grid intersections look uniform

We can set the appearance of the grid like follows: \pgfplotsset{ grid style = { dash pattern = on 0.05mm off 1mm, line cap = round, black, line width = 0.5pt } } The result may ...
5
votes
0answers
161 views

How can I create a 3D Manhattan bar chart? [duplicate]

I have some data which I would like to visualize. This data are 3-tuples of integers: (Threads,Sum,# of occurences) (1,2,20) (1,7,18) (1,100,25) (2,7,15) (4,103,24) I would like to visualize this ...
3
votes
2answers
560 views

How to reference an axis label, e.g. xlabel

I'm new to that forum but it already helped a lot, thanks for this! But now I really got stuck. Basically I'm looking for a possiblity to reference the xlabel of an axis in a TikZ picture. The ...
3
votes
1answer
159 views

One pgfplot per page in single PDF file

I'd like to reduce my redundancy when making plots with pgfplots. I want to have a single PDF file, such that I can include them on a per-page basis with graphicx. The multi class option for the ...
5
votes
2answers
637 views

pgfplots xbar example fails

I have only modified the pgfplots xbar example very little and it completely fails: EDIT: Removed original example, it contained only a missing comma. And do I really need to define for every entry ...
19
votes
1answer
11k views

pgfplots - number format on axis

How can I force pgfplots to draw my axis ticks labels consistently? I mean instead of 0 a 0.0, instead of 1 a 1.0 in the below image. EDIT: Code \documentclass[a4paper,10pt]{scrartcl} ...
3
votes
1answer
1k views

pgfplots - how to specify ticks?

I know how to specify ticks manually. But this is too much work if you have multiple plots. I am searching a way to do that automatically. What I want to specify is the number of ticks for an axis. Is ...
5
votes
1answer
132 views

pgfplots - close path for surrounding rectangle

is it possible to close the path from the coordinate frame in pgfplots? If I plot something, the frame rectangle of the coordinate system looks fine except the bottom left corner: the lines do not ...
2
votes
0answers
183 views

elementwise division of two columns loaded from different files [duplicate]

My next question follows on Sum up rows from different data files where I asked how to sum up the data from different files. In this case I have e.g. two data files, consisting of m (here e.g. m=3) ...
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
331 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
845 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
241 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
171 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
415 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
707 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
731 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
453 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
803 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
144 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
694 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
329 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
895 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
552 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
197 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
679 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
677 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
665 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
358 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
282 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
242 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} ...