{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

2
votes
1answer
57 views

Preventing the graphical xticklabels from stretching

I need to have my x-labels in my pgfplots to be vector graphics. How can I prevent the graphical x-labels from streching? In below is a MWE that can duplicate my problem. The drawn rectangles and ...
4
votes
1answer
39 views

Scale tikz reference in footnote

Using a \ref to a tikz/pgfplots maker works fine in normal text, but it seems not to scale with the text size e.g. the marker is too large in a footnote as in the following MWE \documentclass[14pt]{...
5
votes
0answers
28 views

Skip some x tick labels when using `xtick=data`

I am plotting some csv data with \documentclass[border=10pt]{standalone} \usepackage{tikz} \usepackage{pgfplotstable} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \begin{...
2
votes
1answer
64 views

Skip to long lines in pgfplots

How do I skip lines, that are to long, when using \addplot command and data read from csv file? My database has around 500k points describing position in x-y space. Position can be wrapped around (...
1
vote
1answer
33 views

Increment the x axis by any number

I am new in tikz, I want to increment the x axis by any number(eg:2,3 e.t.c) My current output Expected output I am using following code \documentclass{standalone} \usepackage{mathtools} \...
1
vote
0answers
45 views

x,y axis label values should be node label

I am new in tikz, I want to draw x,y axis and label of x,y axis should the node labels \documentclass{standalone} \usepackage{mathtools} \usepackage{pgfplots} \usepackage{siunitx} \sisetup{per-mode=...
1
vote
1answer
35 views

Create graphics dynamically at the compile time in a pgfplots

I am trying to create a 2D plot in which the x-label ticks are pictures, similar to what is posted here, with the difference that the images be created at the compile time in a parametric manner. The ...
1
vote
1answer
148 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
77 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
77 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
72 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
104 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?
3
votes
0answers
47 views

Dimensions too large on plot

I'm trying to plot a Gauss function/normal distribution, based on the answer to this question, however my domain is 0:10000 and the sample size is 95. This is resulting on the following error: ...
5
votes
1answer
189 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
92 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
95 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
51 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
43 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
38 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 ...
4
votes
0answers
49 views

Fill pgfplot bars with colorbrewer

I want to use colorbrewer in my project since it provides color cycle lists but I struggle to use them in the right way I think. Please have a look at my MWE: \documentclass{article} \usepackage{...
2
votes
1answer
60 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
67 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
23 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
34 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
26 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
86 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
15 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
26 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
84 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 ...
1
vote
0answers
41 views

Dimension too large when changing y axis mode

I am using tikz to plot a figure in x-y plane, however when I change the y axis mod to logarithmic scale, I face to an error "Dimension too large". I searched in this website, but there were the same ...
12
votes
3answers
6k views

matlab2tikz - TeX out of memory

I am using matlab2tikz to import figures from MATLAB to tex. However I quickly get the message TeX capacity exceeded, sorry [main memory size = 3000000]. I have tried expand main memory using ...
2
votes
1answer
41 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
185 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{...
40
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
57 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
123 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
32 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
266 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
31 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
95 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
22 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
82 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
46 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
129 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
77 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
191 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
57 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 -...