Tagged Questions

{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
60 views

How can I make axis lines connected and make axis be over the plot?

I've just put a lot of effort in the following tikz image for Wikiepdia (see commons link): However, there are two small things that I can't get fixed: When you look at the bottom left corner ...
1
vote
0answers
38 views

Fourier transform visualization in 3D [duplicate]

I want to plot this (based on this image from Wikipedia): As far I get this: \documentclass[tikz,border={20pt}]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} % ...
2
votes
1answer
64 views

axis y line*=right does not move ylabel to right

When I recompile this code from the pgfplots gallery (example_291.tex), I get the following graph which clearly does not move the ylabel to the right for the second axis ...
0
votes
0answers
63 views

Second iteration - Is there a way to clear paths previously defined with name path global in TikZ

In realtion to this pretty old question (back 3 years from now) Is there a way to clear paths previously defined with name path global in TikZ? I would like to know, whether there is actually a nice ...
11
votes
1answer
237 views

Why does \mathbb{R} cause '! Undefined control sequence. - \GenericError'?

When I compile the following document, I get ! Undefined control sequence. \GenericError ... #4 \errhelp \@err@ ...
4
votes
1answer
155 views

TikZ nodes in pgfplots saved for later use, but locations mismatch

I really need a quick advice dealing with the answer given by sdaau. See this question. Actually I have a follow-up question regarding the given solution. This works actually pretty fine, but the ...
2
votes
1answer
215 views

Matplotlib's PGF vs Matplotlib2Tikz

I want to generate some plots to be integrated into a LaTeX document compiled with pdflatex. I also want the plot font (legend, title ...) to follow the settings of the LaTeX document. My search so ...
4
votes
2answers
179 views

Stacked bar plot with explicit axis domain

I have a data table which contains positive and negative values for different categories (columns) as input. I want to visualize these values by a stacked bar plot, which shows a stacked bar plot for ...
2
votes
1answer
83 views

x tick label style issue, anchor=east and text width command not working together

I have a figure where one of my labels is very long. I would like this label to be split to two rows. Currently my code is like this \documentclass{article} \usepackage{pgfplots} ...
4
votes
1answer
97 views

3d plot of a surface with nonrectangular domain

I need to make a 3D plot of a step function For example, suppose that I want to plot the function f:[0,1]x[0,1]->[0,1] given by: f(x,y) = 1 if x < y^2 and f(x,y) = 0 otherwise I would like to ...
3
votes
1answer
51 views

How to remove small value labels from ybar chart?

I can't figure out a way to prevent small values showing in my labels. A problem that looked very similar to mine can be found in here. Due to my non-existent coding skills I couldn't figure out this ...
0
votes
1answer
198 views

Why do I get black areas instead of pattern fills when compiling with xelatex? [duplicate]

I want to draw this picture with TikZ. I've used the following code. But the outcome was not good (fig1). While the Fig 2 is the correct form. I do not know where is the problem? My texlive version ...
0
votes
1answer
90 views

Matlab2tikz, alignment of subplot ylabel (large distance from plot)

Matlab2tikz came to my attention in the past month and have been using the simple tutorial from HowToTeX. It has worked great so far only one issue remains, I am unable to anchor the ylabel to the ...
5
votes
1answer
62 views

How to make part of x-axis normal scale and other logarithmic scale in pgfplots?

I'm trying to make such graph (made in Origin), using PGFplots: But I do not know hot to make x-axis correctly. This is my MWE: \documentclass[tikz,12pt]{standalone} \usepackage[T1]{fontenc} ...
5
votes
1answer
113 views

Spherical Rectangle with TikZ / PGF Plots

How would you do a spherical rectangle? I know that for a sphere you do this: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...
0
votes
1answer
79 views

How to do \flushleft and \flushright with tikzpictures

I have two charts, one is drawn with pgfplots, the other with pgf-pie. I want put these two chart in align horizontally, so one is on the left and the other is on the right. I have read Aligning using ...
0
votes
0answers
54 views

How to plot data with time in x-axis, but no date?

I have a set of data in below format, #time #value 01:10 2 02:15 3 02:20 7 ... The 'time' is given in HH:mm format. I want to plot the data with the time dimension on the x-axis. The ...
2
votes
1answer
46 views

Gap at origin when using axis lines*=left in conjunction with line width spec via axis line style

Please forgive the strange graph displayed here - I am simply trying to display a replicable chunk of code in the presence of all the packages I am attempting to use and want to avoid displaying data ...
2
votes
1answer
126 views

Cylindrical Bar Chart

I know this might be a long shot, but does anyone happen to know (or point me to where to start) how to draw this chart. Say we have 6 values (5, 10, 15, 20, 25, 30), one for each column. Thanks in ...
1
vote
1answer
87 views

Scaling pgfplot with tikzscale

I'm using tikz and pgfplots for graphs. When using a second y-axis on the right the scaling of tikz is not proper. So I tried to use the tikzscale package and the includegraphics but it seems to scale ...
6
votes
1answer
128 views

pgfplots: Using the fillbetween library

I want to use the fillbetween feature which is here decsribed by the pgfplots author Christian Feuersänger. In my case I have a coordinate list and want to fill the area between -10 and 10. But it ...
4
votes
1answer
85 views

how to set properly ymax and ytick

I'm trying a plot the left y-axis from 0.5 to 0.88 with 0.88 at the top border of the box (like the 160 at the 2nd y-axis). But even to get 0.88 I have to set ymax and (the last ytick) to 0.9 and ...
3
votes
1answer
86 views

Warning for TeX main capacity exceeded when loading files with \pgfplotstableread

I am loading quite a few data files via \pgfplotstableread, but do not further use them via pgfplots. I just kept them in the preamble and switched to plotting them in a standalone document. But now ...
6
votes
2answers
228 views

Interpolation and curve fitting - Tikzpicture? Gnuplot? Pgfplot?

well, I am fairly new to LaTeX, but I tried my hardest do find a solution for my problem but I couldn't find a proper answer, so I hope someone here has the answer or another suggestion for me. I ...
2
votes
2answers
159 views

Aligning ticklabels in secondary y-axis in pgfplot

I want to right align the ticklabels in secondary y-axiz in pgfplot. Here is my output and MWE. Thanks in advance for your help. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat ...
3
votes
0answers
147 views

pgfplots error using matlab2tikz

I am trying to plot a matlab figure in latex file. so i use this matlab2tikz function. It works really well, until I try to add some customised text on the figure before converting it to tikz file, ...
5
votes
3answers
212 views

Parametric plot using pgfplots package

I want to make a parametric plot using pgfplot in LaTex. My equations are \rho= K (sinh t-t) P= 1/3 K (sinh t - 8 sinh (1/2) t +3t) with K=1\pi I have written the LaTex code for equations , now ...
2
votes
1answer
31 views

How to print in a node the \coordindex multiplied by a value?

I would like to print in a node the \coordindex multiplied by a value. Is it possible? now: node [ some code... ] {$\coordindex$} after (?) node [ some code... ...
3
votes
2answers
99 views

Polar plot with cartesian values, lack of angular precision in the integrated arctan2 calculation?

I noticed that for values close to 0° and 180° the angular values dramatically changes if the values are imported from cartesian data. Here the code (with cartesian coordinates plotted in polar with ...
4
votes
1answer
49 views

Line break in date ticks label

I want to plot some data depending on dates, but as the date range is quite large (4-5 years) I would like to have ticks in the form dd.mm\\yyyy, is it possible ? It would be even better not to repeat ...
7
votes
2answers
137 views

Using LaTeX commands inside pgfplotsset

Is there any way to use LaTeX commands inside \pgfplotsset? For instance, the following code produces an error indicated in the \pgfplotsset line, whereas if one replaced \contents in the ...
1
vote
0answers
88 views

pgfplots - plusminus doesn't match its definition

I've been trying to make a ybar plot with error bar using pgfplots. I want to make this graph inside a tex template, but one weird thing has occurred - when I inserted the following code (be more ...
6
votes
2answers
434 views

Graphing trigonometric functions, axes labeled with tick marks

I am providing the code for graphing three trigonometric functions. (In the preamble, I had to put a % before the command \usetikzlibrary{calc,angles,quotes} because LaTeX could not compile it with ...
3
votes
1answer
70 views

multiple colormaps

I would like to define multiple colormaps. But when I try this \pgfplotsset{ colormap={something}{ color(0cm)=(blue); color(1cm)=(orange!75!red) } colormap={somethingelse}{ color(0cm)=(white); ...
1
vote
1answer
44 views

How can I add the index of value of a table to a point on a graph?

I would like to add to each branch of my polar comb graph the index value as a label. I give you my code and a screenshot with what I would like to have: \documentclass{minimal} ...
4
votes
3answers
172 views

How can already binned data be plotted as a histogram?

I have the following data: [0, 1000) : 14524 [1000, 2000) : 38214 [2000, 3000) : 36169 [3000, 4000) : 25875 [4000, 5000) : 16942 [5000, 6000) : 10603 [6000, 7000) : 6778 [7000, 8000) : 4288 [8000, ...
3
votes
2answers
74 views

How to plot only some value of a table?

I want to plot only some values of an external tex value table, for example from the 3rd value to the 6th value. I could manually comment the non-wanted values but the table may often change and I ...
9
votes
2answers
293 views

Plotting a directed graph using pgfplots

I have a few files in the following format: x y 12 12 12 13 13 15 15 15 15 13 13 12 12 10 10 8 8 8 8 10 10 12 12 12 12 10 10 10 And I wanted to plot them as a directed graph in a ...
4
votes
1answer
49 views

zmin axis value for a 3d plot in TikZ

If I plot this the z axis does not start at 0 but somwhere negative. How do I fix this? \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...
4
votes
1answer
115 views

How to add labels to polar plot / polar comb in polaraxis and show FULL coordinates?

In pgfplots, I am trying to: for a first figure: label 12 polar plots plotted on the bases of 12 tables (values given in cartesian coordinates) without showing a legend but adding a label directly ...
5
votes
1answer
62 views

pgfplotstable will not generate table

I have some data from a table that I would like to tableize with pgfplotstable. After many hours of going through the pgfplotstable 1.10 manual and basicly copying the example code with my data. Are ...
5
votes
1answer
221 views

PGFplots - label each group plots

In this group plot how do I add labels to individual graphs. I want to label each graph as (a), (b), (c)... \documentclass[margin=5mm]{standalone} \usepackage{pgfplots} ...
4
votes
2answers
125 views

Black Fill in my plot

I'm using the following code and when it compiles the result is not what i expect. \begin{figure}[h] \begin{tikzpicture} \begin{axis}[xbar,enlargelimits=0.15] \addplot [draw=blue,pattern=horizontal ...
8
votes
2answers
148 views

Gap between line and point in pgfplots, like pointintervalbox in gnuplot

I wondered if it is possible to create a scatter plot in pgfplots with a similar style as the "pointintervalbox" option in gnuplot, i.e. a plot with points and lines, but there is a gap between the ...
2
votes
1answer
89 views

pgfplot: how to render 3dplot with colors black, white and gray

I my previous question, I rendered a 3d plot, but as I want to print my plots they should be in black, white or gray coloring format. How should I change the coloring scheme? ...
4
votes
2answers
155 views

pgfplot: 3d function plot

After my previous question, I want to plot a 3d surface; as a simple function I tried to render the bellow plot but I was not successful. \documentclass{standalone} \usepackage{blindtext} ...
3
votes
0answers
37 views

pgftables: nodes near coords align depending on value? [duplicate]

The following code results in node labels overlapping the graph. How can I align them depending on the graph so that '1375' und '1574' are below the node and the others still above? ...
2
votes
0answers
68 views

Insert pgf with referenced png file from a different folder

I'm trying to insert a pgf file that I made with matplotlib. This file references to a png file (since I inserted a png figure in the plot). When I put the png in the same folder than my tex file, ...
1
vote
2answers
115 views

pgfplots - How can I define one cycle list for all graphs (or the least amount possible)?

Due to all the maintenance after changing a color in a list, I tried to define just one cycle list so I do not have to update all my lists anymore. It is all in all an annoyingly huge amount of time, ...
2
votes
0answers
130 views

Solid of revolution about arbitrary axis

I'd like to rotate the region between y=cos(x) and y=x^2 - 0.25*pi^2 about the line x=pi. How to do this? So far I have only managed to rotate around the x-axis: \documentclass[letterpaper]{article} ...