Questions tagged [pgfplots]

{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.

517 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10
votes
0answers
201 views

pgfplots: x vs \x

This question is a follow-up to this question ("pgfplots: Strange Bump in \tanh Function"). Stefan Pinnow, who knows a thing or two about pgfplots, provided an answer that distinguished ...
7
votes
0answers
554 views

A problem with pgfplots and coordinates

I'm using Jake's code in his answer to How can I automatically mark local extrema with pgfplots and scatter?. Using the mark max style I can retrieve the value for the y-coordinate of the maximum for ...
6
votes
0answers
117 views

Is there a bug with the `ybar interval stacked` key of pgfplots?

The ybar interval key is used to place the graph bars between the given coordinates. The next 5 coordinates define 4 intervals. This key works as expected and produces the following result. \...
6
votes
0answers
328 views

Custom column intervals in a PGFPlots histogram

Is is possible to give columns in a PGFPlots histogram custom interval of different sizes? Eg. I would like my histogram to have five columns over these intervals: [-100,-50[ [-50,0[ [0,1[ [1,50[ [50,...
5
votes
0answers
102 views

Shift scatter plot according to class

I have a scatter plot with many points at the same coordinate. I would like to shift every point belonging to one class a bit on the x-axis, so that they are more easily distinguishable. I've tried to ...
5
votes
0answers
450 views

`imshow` like diplay of image with colormap

I would like to show an originally gray scale image with a specific colormap like matlabs/matplotlibs imshow. Original: % python import matplotlib.pyplot as plt import matplotlib.image as mpimg ...
5
votes
0answers
161 views

Using pgfplots with raw gnuplot plotting commands, is it possible to reuse tikzpictures?

I have a main.tex in which I import plots as tikzpictures with includegraphics. A typical plot looks like this \begin{tikzpicture} \def \dataFile {'plots/data/sample_data.dat'} \begin{axis} \...
5
votes
0answers
595 views

PGFPlots fillbetween layer issue with main layer

I am using fill between to create some diagrams where I need semi-transparent fillings above ploted lines. As normally fillings are put into a separate layer pre main below plot lines, I tried to move ...
5
votes
0answers
622 views

Automatically externalizing content of a PGFplot as a PNG

I've got basically the same issue as in this question: I have a rather complicated plot made with PGFplots and I can get a very significant file size reduction by using a rasterized image (PNG) ...
5
votes
1answer
1k views

How to select a range of data within a .csv file in latex using pgfplots?

I am generating a plot of data using pgfplots in latex. I am using data from several excel files as .csv. Here is the MWE: \documentclass[border=5mm,convert]{standalone} \usepackage{pgfplots} \...
5
votes
0answers
1k views

Flip x and y axis of ternary graph

I am trying to reproduce the USDA Soil Triangle. To do so, I would need to flip the x and y axis of the default pgfplots-ternary. I understand, that I could switch my inputs (don't really want to do ...
4
votes
0answers
147 views

Plotting a 3D graph in Latex

I am trying to change the 2D scatter graph into 3D which can also take the value of the P column as z-axis. But the output I got is not smooth and I really don't understand how I can change it into 3D ...
4
votes
0answers
166 views

tikz-3d/pgfplots: How to draw/plot curved spacetime?

Since I try to write a short introduction to tensors for physics students, I mentioned the Einstein's field equations (as a motivation). Therefore, I wanted to create a tikzpicture/pgfplots of curved ...
4
votes
0answers
326 views

pgfplots/Bar Chart: Don't leave room, when value is 0

I've got a bar chart with two main bars (black, x ticks). Each of the two bars is specified by several different sub-bars (filled resp. pattern). As the first bar at x-coordinate 1 is described by ...
4
votes
0answers
171 views

Pgfplots: fill between let the axis options to be neglected

In the following example, the axis lines should be yellow and ultra thick, but using the fill between instruction let the axis options to be neglected: \documentclass{standalone} \usepackage{pgfplots}...
4
votes
0answers
1k views

Compute convolution of discrete signals in Tikz

I want to draw a simple graphical example of a convolution of two discrete sequences in TikZ. I used the code from this link to get my result, which is already what I want but, so far, the values of ...
4
votes
0answers
99 views

Is there a way to automatically force xticks on first and last data point in pgfplots?

I have created a custom pgfplot style which allows me to create line plots with the x axis being a time in hh:mm format. The data is loaded from .csv files. The automatic tick placement on the x axis ...
4
votes
0answers
929 views

Crop z-axis of PGFPlots

I try to implement the following image of the function 1/(x*y) I plotted using WolframAlpha using the PGFPlots package: The function is not defined if x=0 or y=0, so I split it up into four parts ...
4
votes
0answers
1k views

Groups of boxplots using symbolic coordinates

I would like to create a plot similarly as to the bar plot example, but with boxplots instead of bars. So far what I have this MWE: \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots} \...
4
votes
0answers
954 views

Automatically positioning a legend relative to multiple plots in groupplots

This question deals with centered legend placement in a set of plots aligned with groupplots. However, as the OP stated in a comment, the (accepted) solution requires some hand tweaking. I suspect ...
4
votes
0answers
669 views

pgfplots: rotating a shape in 3D independent of the axes

I have a group of shapes I'm plotting in 3D via \addplot3 (such as a cone) and need to have them pointed in a direction specified by the macro arguments. I do not want to just change the view angle or ...
4
votes
0answers
834 views

Pgfplots histogram with density less than one

I want to plot two histograms over each other in order to compare densities of two different datasets. The problem is that the second dataset has less observations than the first one, and I want its ...
4
votes
0answers
2k views

using gnuplot to plot data from a file

I am trying to plot some data using pgfplots, but the data are so extensive that the maximum capacity is reached. I get the error: TeX capacity exceeded, sorry [main memory size=3000000]. What can I ...
4
votes
0answers
929 views

How to automatically optimize the PDF output of TiKZ externalize?

I use pgfplots with externalization for generating plots in my document. For heavy plots the output PDF for a figure can grow to few hundred KB. I used Adobe Acrobat to optimize the PDFs which ...
3
votes
0answers
88 views

Dimension too large for this tikz. How to resolve?

I am using MATLAB to plot some graphs and then using matlab2tikz() to convert these MATLAB graphs to tikz. The issue I have now is that one of the graphs I have after converting it to tikz, failed to ...
3
votes
0answers
60 views

Dimension too large when using path to include graphics

Im trying to include an image as xy-plane on z=0. See mwe. ymax is supposed to be 1500. But when I change ymax to 1500, the domain, (axis cs:7.5,75,0) coordinate (P) to (axis cs:7.5,750,0) coordinate (...
3
votes
0answers
111 views

how can I fill an “fill between” area by point meta?

All, consider the following MWE: How to fill the blue!20 area by point meta e.g., point meta=x^2 ? I mean the filling should be like a contourplot, with colors determined by some function (like x^2)...
3
votes
0answers
162 views

pgfplost: Accuracy of the color gradient in matrix plot

I want to plot a matrix with pgfplots to match the style of the rest of my LaTeX document. The desired output is something like this plot from Mathematica: But when I try to plot this data with ...
3
votes
0answers
70 views

How to plot measured signals? i.e. large number of points

So far I used TikZ/PFGplots to plot small potions of (simulated) signals, drawing schemes, etc. but when it comes to actually measured signals (e.g. at 10 kHz), you easily end up with millions of ...
3
votes
0answers
54 views

Wrong font scaling using when groupplot, tikzscale and fillbetween, maybe a bug (?)

Situation: I am trying to place one bigger pgfplot at the left side of a figure and four small plots (2x2) on the right half, like this: |--------|----|----| | | P2 | P3 | | plot 1 |----|-...
3
votes
0answers
160 views

PDF version <1.7>, but at most version <1.5> allowed

I used a C++ function my teacher gave us to create some ppm files, which I then converted to the eps format using an online resource for use in my report. However, these images are causing problems. ...
3
votes
0answers
152 views

possible (major) bug with pgfplot axis labeling?

I tried compiling a bunch of files today, all of which use tikzpictures and pgfplots. Something truly odd is happening with how the y-axis label is being positioned. I took the MWE from Positioning ...
3
votes
0answers
65 views

Align pgfplots horizontally

I want to align the pgfplots seen in the picture below. I already tried with \pgfplotsset{yticklabel style={text width=3em,align=right}}, but as you can see, the plots are still not aligned. The ...
3
votes
0answers
69 views

Colormaps within group plots with date coordinates in pgfplots

I am having issues when using colormaps within group plots that have date coordinates in x. \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{...
3
votes
0answers
239 views

pgfplots: Best practice to avoid "TeX capacity exceeded" when plotting huge data sets?

I want to create some huge pgfplot with three different axis and a lot of data points. In summary there are 20160 lines of data existent. My problem is: All few hours the values will change ...
3
votes
0answers
166 views

Differences between pgfplots and tkz-fct plots

I am trying to choose between pgfplots and tkz-fct for producing beautiful graphs in LaTeX. It seems tkz-fct graphs look better with less effort (fewer lines of code) compared to pgfplots. The ...
3
votes
0answers
383 views

Tikz multi-bar plot custom bar position

I have a multi-bar plot that contains single and multi bars: I want to make the single bars A and D in the center; right now they are left aligned. The following is the code: \begin{tikzpicture} ...
3
votes
0answers
169 views

One label for each open contour line

I'm trying to set only one label for each contour line, but all the solution for closed contour line failed for open contour lines, like the option label distance=10000pt. How can I do this? \...
3
votes
0answers
376 views

Is it possible to make pgfplots use 3D spherical coordinates?

I am wondering if one can install 3D spherical coordinates in pgfplots (not TikZ). Questions of this sort have been already asked, but as far as I can see, the answers here, here, here and here all ...
3
votes
0answers
38 views

Scaling the Axis of a pgfplot

So I've been fighting with LaTeX for a while now and haven't really gotten a conclusive answer on how to deal with this issue. I have a plot and this is how my axis looks like. I obviously want to ...
3
votes
0answers
224 views

pgfplots - filldraw disappears after adding plot

I have some plots in my graph and want to mark a special area with a square. Here's what the plot looks like: \begin{tikzpicture} \begin{axis}[axis lines = left, xlabel = {Player 1}, ylabel = {...
3
votes
0answers
248 views

PGFPlot 3D opacity and appearance

I used MATLAB to generate some 3D figures and I would like to show two surfaces in one graphic using PGFPlots. In order to better illustrate the surface differences, I set opacity = 0.5 for both of ...
3
votes
0answers
172 views

Opacity of plane has no influence on points behind it

I created the following figure of my data points and a regression plane: I would like the data points above the plane to remain black but the data points below the plane to be blue. I thought this ...
3
votes
0answers
128 views

pgfplots .provide style similar to tikzset's .provide style

I have been using tikzset{style name/.provide style={}}from Is there something like \providetikzstyle similar to \providecommand? defined as \tikzset{/handlers/.provide style/.code={% \...
3
votes
0answers
296 views

Plotting data lines properly annotated with pgfplots

I am plotting a series of rather busy plots consisting of many (5..25) lines of experimental data using pgfplots 1.14 and TikZ 3.0.1a. These curves are often overlapping, coexist near x or y axis, and ...
3
votes
0answers
788 views

Pgfplot filled contour-sharp edges

I am trying to get a smooth filled contour like the following one: Similar to this.(ignore the line plots inside) For this purpose, I use contour filled. However, I am not getting a smooth filled ...
3
votes
0answers
268 views

PGFplots, polar plot, extrema of values and fill segmented area

i have some testdata and want to create a polar plot, divided into some segments (21-24, 31-35, 41-42, ...). From the testdata i greate about 50 graphs (Var 1 ... Var x). Up to this everything works ...
3
votes
0answers
1k views

How to set a fixed bin width for pgfplots histogram?

I want to plot multiple histograms next to each other using pgfplots, and I found the nice statistics library. However, I can't find how I can set the bin width at a fixed size instead of the amount ...
3
votes
0answers
1k views

Error bars with color on pgf plots

I was trying to make my error bars the same color as I have for my data on pgf-plot. The method was greatly explained earlier here - Define error bar color in scatter class My code at the beginning \...
3
votes
0answers
389 views

Error `tikzscale` package when scaling a figure, containing two axis environments next to each other, to the text width

I have a figure environment with which I depict two pgfplots axis environments next to each other. I want to scale the figure such that it uses the full \textwidth. I attempt to do so by means of the ...

1
2 3 4 5
11