{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
1answer
150 views

Choosing location of legend entries in Pgfplots

I am fairly new to using pgfplots and have been combing the manual for a couple hours now and I can't find an elegant solution to my problem. I would like to have two columns of legend entries and ...
5
votes
1answer
81 views

String concatenation in Tikz

How can I replace the sequence (in a pgfplots, Tikz environment) \addplot[black] table {plot3/fnxspy1.txt}; \addplot[black] table {plot3/fnxspy2.txt}; \addplot[black] table {plot3/fnxspy3.txt}; \...
2
votes
2answers
85 views

Plotting two 2D-plots in a 3D plot using pgfplots

I am trying to create a 3D plot similar to a standard xyz coordinate system by using pgfplots. I want to plot two 2D plots one in x1-y and one in x2-z plane, similar to the following illustration (...
3
votes
1answer
80 views

How to remove the axis lines

How to remove the axis but the label should be there Eg:current output Expected output I am using the following code \documentclass{standalone} \usepackage{mathtools} \usepackage{pgfplots} \...
2
votes
2answers
109 views

How to draw a graph of a specific form in LaTeX

How can I draw a graph like this in LaTeX using pgfplot package?
5
votes
1answer
191 views

How to improve visibility of a black and white plot?

I'm plotting information from 10 sets in the same plot. The result is very messy since the lines for each game intersect and overlap with each other, and the width of the final image is small. Here's ...
6
votes
1answer
101 views

using variables or commands in pgfplots axis definitions

This is probably a silly way of doing it but bear with me. I have a document in which I define values in lua tables to reuse them either in a tables or in a pgf plot after applying some calculations ...
4
votes
1answer
100 views

visualizing matrix factorization

I want to create diagram like below. Update: Mostly done. \documentclass{standalone} \usepackage{amsmath} \usepackage{tikz} \usepackage{colortbl,pgfplotstable} \pgfplotstableread[header=false]{ ...
1
vote
0answers
62 views

Tikz Pgfplot-Create user defined colorbar

I want to create only colorbar in Latex. Earlier I have used to Gnuplot to plot heatmaps along with colorbox(yeah, They are called colorbox in Gnuplot). The user defined colorbox in Gnuplot plot is ...
2
votes
1answer
45 views

Problem with plotting function with pgfplots (Takagi function)

I'm trying to plot step functions that when sumed will constitute the Takagi function. The graph of the first step functions is as it should be, but the graph of the second one fails. See the MWE ...
4
votes
0answers
40 views

pgfplots: Plotting one subfigure per country, from datafile

I have data in csv format at the country-year level, and using pgfplots I would like to plot a given variable over time, with one subfigure per country. My idea was to use a groupplot environment: and ...
2
votes
1answer
65 views

Highlight the label with in the node

I am new in tikz,I am manually create an image,In that figure coloured part shows that highlight the label how I do this by tikz I am using the following code for the label, How alter this code. \...
4
votes
1answer
80 views

define color in pgfplots

I want to plot funtions and data with own colors using \definecolor{<name>}{<model>}{<value(s)>}. If I use this command in \tikzpicture it works. But if I use this command in ...
2
votes
0answers
28 views

Plot cumulative normal distn in tikz

I tried to follow Jake from Plotting bell shaped curve in TikZ-PGF with slight modification. 1) I just want the univariate normal cdf with red dash line at the cut-off, but some how my dash line seem ...
2
votes
1answer
38 views

Mirror X axis-pgfplot

I have to plot a hysteresis data. Instead of putting it in a single plot. I would like to put it in 2 plots but I want X-axis of second plot to be a mirror image first plot's x axis. How can I do this ...
0
votes
0answers
19 views

Use constant regression of pgfplot in calculation

I'm new in latex and i have a problem with regression function in log-log graphic of pgfplots. With linear regression in loglog graph it will return slope and intercept with \pgfplotstableregressiona/...
2
votes
1answer
40 views

Reference pgfplots' groupplot with subcaption

I created a groupplot with pgfplots. For referencing each plot I added a subcaption within a node into each plot. \documentclass{article} \usepackage{caption} \usepackage{subcaption} \usepackage{...
4
votes
1answer
88 views

Plotting ranges of data with tikz or pgfplots

I have a sample with countries and data. I would like to have a "comb" graph to show the years covered in the sample for each country. My data is like this : ####################################...
1
vote
0answers
17 views

Setting fontsize dynamically at runtime in matlab2tikz

I'm using the following matlab2tikz command to convert a Matlab plot into tikz: cleanfigure; matlab2tikz('test.tikz', 'height', '\figureheight', 'width', '\figurewidth', 'showInfo', false, 'strict', ...
3
votes
1answer
27 views

Result of Catchfile doesn't work inside a tikzpicture environment [duplicate]

This is a follow-up to this question. I am trying to get points to be graphed using data from an external file. The vertical coordinates are countries, and the horizontal ones are years. For this to ...
6
votes
1answer
88 views

pgfplotstableread + addplot table: scale column for re-use

I get output files from a code and I want to display the output file with pgfplots. I want to create several different plots with the same files. Therefore, I read them in a macro with pgfplotstable. ...
2
votes
0answers
18 views

Pgfplots center plot horizontally, disregarding legend [duplicate]

I tried a lot around with setting anchors in the plot, but I couldn't manage to center the plot correctly. In this example the bounding box of plot and legend gets centered, but I want the plot ...
2
votes
1answer
43 views

Label problem in figure

I am new in tikz, in below red boxed parts shows x,y axis labels, Now it's automatically (appearing) incrementing (0,5,10,15,20) my expected out is like (1,2,3,4). I am using the following code. How I ...
6
votes
2answers
194 views

How to fill the space between two \draw lines

I am drawing two lines and I need to fill the space between them with a green color. How can I do that in tikz? \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{patterns} \begin{...
41
votes
3answers
15k views

Pgfplots: how to fill the area under a curve with oblique lines (hatching) as a pattern?

I want to hatch the area under a curve (graph of a function) with oblique lines on an interval (to illustrate the function's integral on that interval). This can be done elegantly in gnuplot... ......
2
votes
1answer
63 views

pgfplots: macro to draw lines from point to y-axis

After reading pgfplots: help with macro to drop line to x-axis, I was wondering if I could do the same thing but with a line connecting the point with its y-axis projection. So I tried to modify the ...
2
votes
4answers
129 views

Can I connect the end of an \addplot to the beginning of the next \addplot?

I'm using pgfplots to plot an implicit equation, but I'm running around using gnuplot by parametrizing the curve instead. The down side is that my parametrization necessarily comes in curve segments. ...
2
votes
1answer
36 views

Tick labels with decimal places

I want to have my axis tick labels in a plot with the first decimal place: 2 -> 2.0, 5 -> 5.0 Have anyone an idea how to do this?!
2
votes
1answer
271 views

pgfplot same size font in figures and same size figures

Hi I've created figures with standalone and pgfplot package. The figures output size are different to one another but more importantly the font size are different. I would like all figures to be of ...
14
votes
1answer
1k views

How can I automatically mark local extrema with pgfplots and scatter?

I am trying to have TikZ automatically mark a local maximum in a fourth-degree polynomial I built using a curve-fitting tool. I am new to LaTeX and TikZ, and am a bit overwhelmed - there seem to be a ...
0
votes
0answers
39 views

Dynamically setting the fontsize with matlab2tikz

I'm using matlab2tikz to create a tikz file out of my Matlab plot. I'm using the following code: cleanfigure; matlab2tikz('test.tikz', 'height', '\figureheight', 'width', '\figurewidth', 'showInfo', ...
0
votes
1answer
99 views

scale bar figure - showing scale with citations

I am attempting to make figures similar to this: with latex. I would like for the citations to work in order to match the observed data from where it came. Does anyone know of a good package ...
2
votes
1answer
24 views

Repeated and misaligned xticks in PGFplots

I have a problem with the xticks in my PGFplot that I'm not sure how to even start troubleshooting. The tick labels are repeated and misaligned; basically they are all over the place. \...
8
votes
2answers
87 views

tikzpicture cv graph

I've got a problem with tikzpicture. I've made my cv in Latex but one thing isn't working fine. The first graph should look like the other ones. If I remove the enlarge y limit={abs=1cm}, the graph ...
3
votes
1answer
66 views

Problem with ticks and caption when importing Matlab figures using matlab2tikz

I have created a nice plot in Matlab and converted it into tikz with the matlab2tikz library. It works great but there are two problems: The ticks of the axis are not good. Especially for the y-axis ...
4
votes
1answer
130 views

Draw a sequence of functions

I want to draw thw following sequence but I don't know how to do that. f_n(t)= \begin{cases} -1,~ -1\leq t\leq -\frac1n,\\ \frac{t}{n},~~~\frac1n\leq t\leq \frac1n,\\ 1,~~~~~\frac1n\...
5
votes
1answer
79 views

Graphic-Tikz in latex

I have the following code: \documentclass[]{article} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \pgfmathdeclarefunction{gauss}{2}{\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2)...
3
votes
0answers
239 views

Coordinate Transformation for labeling with PGF-Plot

Difficulty with drawing the right coordinates I use pgfplots to draw a set of data points, fit them with gnuplot and then find the intersection points between the linear fits and a vertical bar. Now ...
1
vote
1answer
60 views

Plots are too small with two minipages

I have two plots, each one in a minipage, so they could be side by side. The left plot is significantly smaller than I would like it to be. How can I fix it? \begin{frame}[t,fragile]{CI construction -...
3
votes
2answers
127 views

How to use Tikz/Pgfplots to plot an algebraic curve on a restricted domain?

I want to plot for example equation y^2 x + x^3-3y^2-2x^2+x=0. But at the same time I need to gray out some parts of the plane (see shaded area). Is there a way to do this?
2
votes
1answer
56 views

Pgfplots: Scope inside axis environment or other relative positioning

I want to place an external figure inside a pgfplots plot. Additionally, I want to put some labels inside the external figure to mark the position. The expected result should look something like this:...
3
votes
1answer
33 views

Pgfplots: Scope inside axis environment - follow up

This is a follow-up question to this question: I still want to place an external figure inside a pgfplots plot. Additionally, I want to put some labels inside the external figure to mark the position....
0
votes
1answer
43 views

Standalone and PGFplot cropping

As asked here I set up a template for plots that can be used with standalone and included into the main document. 1 remaining problems is that the cropping does not crop enough of the whitespace ...
1
vote
1answer
14 views

Pgfplots: Alphanumeric x tick label

I have some data that needs to be plotted against time. But the time is not absolute (NOT 0,1,2,3,...). So I want to represent x tick label as relative labels (like t, t+1, t+2, t+3, ...). My data set ...
2
votes
0answers
51 views

Bar graph with elements from the document

In my document, I define some elements which all have a number (from 1 for the first to n for the last one) and a level (1, 2 or 3). At the end of the document, I'd like to create a bar-graph with ...
1
vote
1answer
49 views

pgfplot: plot non-numerical data from CSV file [duplicate]

I have a csv file like: column1,column2 string1,value1 string2,value2 … Values are integers, strings are alphanumeric. I tried to plot it, with strings on x axis and values on y axis. After some ...
2
votes
0answers
86 views

How to create a checkerboard tile pattern in pgfplot tikz

I am aware of several patterns available in tikz patterns, such as vertical lines, crosshatch and etc. However, I need to create some tile pattern similar to that of checkerboard pattern in order to ...
0
votes
1answer
53 views

Change direction of tikz pgfplot colormap

i want to change the direction of the colormap of a scatterplot. The "best" points in my plot are in the lower right, the "worst" in the upper left. So it would be nice, if the points in the lower ...
2
votes
2answers
93 views

How to use colors from a pgfplots colormap in pie chart?

I like the pie chart from http://www.texample.net/tikz/examples/pie-chart/, but it's in grey color. Then I found the modified version to add colors by "Sigur" here:How to give different color to each ...
1
vote
1answer
64 views

How to make the axis of the same?

How can I reproduce the top picture? Here's what I have so far: \begin{tikzpicture} \begin{axis}[xticklabel style={anchor=east,rotate=90}, date coordinates in=x, xticklabel={\day.\month.\...