Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
58 views

Drawing graph for all curves describing solutions to differential equations [duplicate]

I apologise at the outset for not publishing any code, mainly because I have no idea how to do this. Although I have managed to produce the graphs by hand and have a reference figure, I have yet to ...
Bml's user avatar
  • 115
1 vote
1 answer
34 views

Colormap along the line curve rather than the axes

Using data from a file, I would like to color the line curve using a custom gradient. However, I would like the gradient coloring to span the line curve rather than the axis. To better illustrate the ...
Meclassic's user avatar
  • 1,827
0 votes
0 answers
19 views

draw command doesn't work in axis environment

I have tried to draw an ellipse in the axis environment, but whether I use axis cs or not, and even though there are no warnings, no ellipse is drawn. This is a mwe: \documentclass{standalone} \...
Luca Maria De Vita's user avatar
3 votes
1 answer
44 views

pgfplots "no ... in font nullfont" with `y filter`

I get no ... in font nullfont warnings in the log when I use y filter in a plot (using the approach in this answer). MWE: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{...
LarrySnyder610's user avatar
4 votes
2 answers
265 views

Use for loops to generate TikZ coordinates corresponding to linear combinations of vectors

I am trying to draw linear combinations of vectors. I started defining coordinates manually, but it's too time- and space-consuming: \begin{center} \pgfplotsset{compat=1.15} { ...
EthanAlvaree's user avatar
  • 1,411
1 vote
0 answers
33 views

Plot the fractional part function

To plot the fractional part function f(x)=x-floor(x), I use the following code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \begin{center} \begin{...
Dimitris's user avatar
  • 1,551
2 votes
1 answer
46 views

Data visualisation: datavisualisation library or pgfplots

I am trying to migrate by lab data visualistion routine from matplotlib to latex. I came a cross some libraries, including the package pgfplots and the tikz's datavisualisation libarary. I am not sure ...
Martin's user avatar
  • 35
0 votes
0 answers
20 views

Contour gnuplot from data in external file

I'd like to create a contour plot of data stored in the file "test.dat". There should be one continously shaded contour plot and then I'd like to "highlight" some contour lines ...
Phil_B's user avatar
  • 1
3 votes
1 answer
72 views

intersection points, line and contour

For this question, I refer to the post connect sides by arrows in any contour, polygonal figure, closed curve, etc. Here is the code modified by me. What I want is to mark each intersection point of ...
Jack's user avatar
  • 265
0 votes
0 answers
22 views

\usetikzlibrary{babel} does not work [duplicate]

In this code: I want to label an angle. I made \loesung to make one document with \loesung to hide. Otherwise i allways need two documents and herw i can switch the toggle showcomment and everything ...
Patrick's user avatar
  • 107
0 votes
1 answer
31 views

Subcaption and size of subfigure are offset

I haven been trying to create a figure with two subfigures aligned next to each other. For the life of me I cannot find a solution. The right subfigure is slightly bigger, and its subcaption is ...
nico's user avatar
  • 5
1 vote
0 answers
35 views

Custom 3D Coordinate System in pgfplots

I am trying to create a custom 3D coordinate system using pgfplots in LaTeX. I want to define three direction vectors x, y, and z. However, when I define x=(-0.35,-0.35) and then define y and z, the ...
Wu Guiping's user avatar
7 votes
1 answer
286 views

LaTeX (on overleaf) keeps cutting off my polynomial plots

Here is the preamble and the code for the graph: \documentclass[12pt]{article} \usepackage{graphicx} % Required for inserting images \usepackage{pgfplots} \usepackage{amsmath} \usepackage{enumerate} \...
Kelli A.'s user avatar
2 votes
2 answers
70 views

What is the best practice to define a newcommand to derive the projection of the curve intersection with specific x-axis notation?

I encounter a confusing problem when deal with the projection of the function figure as below. I wonder how to modify my tex code's definition of \newcommand{\ShowIntersectionsAndVerticalLine} with 4 ...
Explorer's user avatar
3 votes
2 answers
103 views

Generated PDF renders differently on screen from printing

I'm not sure it is an issue related with LaTeX or due to the printer I use, but well, here is the problem I face. Please forgive me if I'm not submitting the issue in the right place! I generate a pdf ...
Philippe's user avatar
2 votes
1 answer
38 views

Define a color interpolation depending on the value of an array

I have this code that works: \documentclass[border=0pt]{standalone} \usepackage{tikz} \def\graphsize{6} % It must be 1 less than the number of nodes \def\precision{ {0, 0, 0, 0.5, ...
Tendero's user avatar
  • 201
2 votes
1 answer
64 views

Arrows above thicken portion of curve

I have the following code and I want to plot the arrows above the pink thicken portion but to keep their order. \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
Jack's user avatar
  • 265
0 votes
1 answer
33 views

Graphical problem with double y axis

Initially, I displayed all my data with a single y axis (without concern for scale for the quantities a0, a1 and a2 which go from 0 to 1). I would like, for these 3 quantities, to display them on a ...
Nicolas's user avatar
  • 1,257
4 votes
1 answer
92 views

connect sides by arrows in any contour, polygonal figure, closed curve, etc

I have the following and I want to make the figure look like its one piece, without separate parts. I want in general, sketching any contour to be able to draw arrows from one side to the other in a ...
Jack's user avatar
  • 265
0 votes
1 answer
48 views

Minipage inside fbox is not aligning to top [duplicate]

I have two minipages inside a box as seen in the picture below. I want both sides to format to the top, but the right hand side is not formatting even if I use [t]. The code is: \documentclass{...
ZOMBYSPIDER's user avatar
0 votes
1 answer
38 views

crossreferencing via \label and \ref in pgfgantt?

It does not seem possible to refer via \ref to elements in pgfgantt. Or is there some way to do so? EDIT: I would be interested to have a similar functionality as the one available in pgfplot with ...
Jpk's user avatar
  • 121
0 votes
1 answer
32 views

I would like to know how can I correct the mistakes in this plot

I need some help to correct my plot in Latex (overleaf). as you can see int eh photo attached I was not able to move the left Ylable more to the left. I addition the legend are overlapping. I would ...
Yogan Felipe Sganzerla's user avatar
3 votes
2 answers
87 views

(wrong) marker - colors

I am taking my very first steps in tikz and pgfplots. I use the following packages %TIKZ \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} I plot a so called bode-diagram, that is ...
framlin's user avatar
  • 33
0 votes
1 answer
38 views

How to plot a scatterplot and function in the same figure?

I've been trying to plot something using TikZ and pgfplots, however, when I try to plot a scatterplot and a function in the same figure, the function appears as a bar graph. Here is the code: \...
Benzv2001's user avatar
1 vote
1 answer
46 views

Shade between x-values given in an external file - pgfplots

I'd like to achieve the following plot: \documentclass[a4paper]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \begin{filecontents}{data.txt} start,end 1,23 51,69 106,165 ...
cedi123's user avatar
  • 43
0 votes
1 answer
72 views

Problem of resizing and scaling

i have to make this table My code have 2 problems, one i want (grey or dotted) line to be at scale entry 1, then entry(2,5,10) will be on one side and entry (0.01,0.05,0.1,0.2 and 0.5) on other side. ...
Maryam's user avatar
  • 53
2 votes
1 answer
49 views

How do I avoid 'TeX capacity exceeded' error, even though I have a small dataset?

I'm trying to make a scatterplot of some measurement data, which is only a <100 datapoints. So here is my code, hopefully you can help me solve this issue: \documentclass[12pt]{article} \usepackage{...
Benzv2001's user avatar
0 votes
1 answer
119 views

What will be the overleaf code for this table

[![Estimated effects of ribavirin compared with no treatment on mortality outcomes from studies][1]][1] This is cation of table This is table link [1]: https://www.ncbi.nlm.nih.gov/pmc/articles/...
Maryam's user avatar
  • 53
3 votes
1 answer
26 views

axes titles not displaying on pgfplot

i'm new to latex, and was recently using pgfplots, but wanted to label everything so i went back and used x label style, y label style, xlabel, and ylabel to display labels. the code for my labels ...
vice 11's user avatar
  • 31
3 votes
1 answer
111 views

How to code so that the dashed gridlines look like the second picture

how do I code in latex so that I obtain the second picture below? I’d like the dashed gridlines specifically to be like the second picture. This is my attempt (first picture): \documentclass{...
Curious cucur's user avatar
0 votes
1 answer
44 views

Creating Lua filters; tikz externalize trouble

This is a draft of the Lua filter that I plan to use with Pandoc. The goal of this filter is to locate images created synthetically with TikZ (no images imported with `\usegraphicÚ), create a ...
user3204810's user avatar
  • 1,509
0 votes
1 answer
63 views

Scatter plot with discontinuity

I have a lot of these scatter plots to produce. I am not able to get the discontinuity correct on both axes an line up labels on both axes My MWE \documentclass[tikz, margin=3mm]{standalone} \...
Jon's user avatar
  • 539
3 votes
1 answer
30 views

Cannot use TikZ-FeynHand with `trig format=rad`

TikZ-FeynHand fails to draw propagators when trig format=rad. Is there a way to use TikZ-FeynHand while having trig format=rad globally? \documentclass{article} \usepackage{tikz-feynhand} \usepackage{...
Ulysses Zhan's user avatar
2 votes
1 answer
26 views

In PGFPLOTS, x-tick value being "rounded" from 1024 to 1020 in log-log plot with "log ticks with fixed point"

In the following example, I'm not sure why the last x-tick is showing as 1020 rather than 1024. I assume it's a number formatting issue. Any advice is very much appreciated! I include a MWE and ...
tgkolda's user avatar
  • 748
1 vote
0 answers
31 views

pgfplots: How to fill an area under a data set [closed]

I have a pretty big data file (8192 lines) and when i try to fill the area ander the function it fills the area above. How can i fix this? A piece of the data file: E Ch 228.2592147 820 228.4568005 ...
João Santos's user avatar
3 votes
1 answer
80 views

How to increase accuracy when scaling data from table in pgfplots

I try to plot data with a small range but a large offset (my x data is a time in seconds, ranging from 26400 to 264480) and seem to reach accuracy limits of pgfplots when scaling this data after ...
Inor's user avatar
  • 33
1 vote
3 answers
51 views

Infinite loop in foreach in pgfplots axis?

I'm trying to generate a staircase plot by computing the coordinates with a foreach loop, but the compilation never stops and gives nothing. A minimal example follows: \documentclass{article} \...
vonbrand's user avatar
  • 5,541
0 votes
2 answers
61 views

Overlay text over a PGF plot in a minipage

I use matplotlib to export plots in the pgf format, such that I can include it in LaTeX and have it be rendered crisp and beautiful. I can use minipage to order the plots in a figure and create e.g. a ...
BernhardWebstudio's user avatar
0 votes
0 answers
30 views

Export tikz images to odt file on Windows: trouble with pdf2svg

I would need to convert my .tex file into an editable format such as odt. After various vicissitudes, I managed to find the right way. The equations are exported almost correctly (the command (\sin is ...
user3204810's user avatar
  • 1,509
2 votes
2 answers
84 views

"axis" and "node" don't be aligned with "tikz"?

When align the tikz figure and another node,they are not aligned perfectly. For example \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[name=...
Y. zeng's user avatar
  • 2,105
2 votes
1 answer
31 views

How to remove "draw" for marks in "addplot" in tikz?

With tikz, when plot the points by \addplot, the draw=none doesn't work. What is the reason and how should I remove the black line around the point? \documentclass{standalone} \usepackage{pgfplots} \...
Y. zeng's user avatar
  • 2,105
3 votes
0 answers
32 views

How to display y or x axis break with pgfplots?

Looking at this topic (Axis break in pgfplots), I found a way to "break" my x axis on some data I have. However, I am not truly satisfied with the result. Here is a minimal plot of my ...
Adrien Lebeau's user avatar
1 vote
1 answer
57 views

Fine tuning: TikZ, pgfplots and Lennard-Jones potential

I'm trying to recreate a faithful copy of the graph shown here. I'm trying and trying again, but I would like to make the curve tend to infinity more quickly for x=0 and tend to 0 more quickly for x=...
user3204810's user avatar
  • 1,509
4 votes
2 answers
216 views

How to draw such a diagram in Tikz with both positive and negative bars

How to draw such a diagram in Tikz in the easiest way? You can send a link to a similar example. MWE: \documentclass[tikz, border=2pt]{standalone} \usepackage[main=russian,english]{babel} \usepackage[...
Youra_P's user avatar
  • 1,128
1 vote
1 answer
53 views

pgf import in LaTeX not working due to matplotlib axes font

I was plotting as usual and then after saving one of my plots as a pgf and then compiling LaTeX it didn't work anymore. As far as I'm aware of, I didn't change anything it just so happen to top ...
L_physics's user avatar
0 votes
0 answers
17 views

shared legend position is not changed

\documentclass{article} % Standard package includes \usepackage{times} \usepackage{latexsym} % For proper rendering and hyphenation of words containing Latin characters (including in bib files) \...
O Y Jo's user avatar
  • 25
3 votes
2 answers
105 views

plot a function in a subdomain with pgfplots

I'm trying to plot the function $-log(x^2+y^2)$ in a circular domain centered in (0,0). With addplot3 I can plot it on the square domain $[-1,1]^2$. With what I found here pgfplots and ifthenelse, I ...
Thomas's user avatar
  • 285
0 votes
1 answer
43 views

Formatting table with plots

Can someone help me format this table: I would like a little bit of space between the plots and the upper and lower margin of their respective cells. I dont know how to make the weaky relu function to ...
juan19.99's user avatar
1 vote
1 answer
80 views

Graph hardly readable - pgfplots options difficult

I am trying to create a plot representing the number of articles about resilience over a period of time. The data comes from a txt file, looking like this: Publication Years Record Count % of 141519 ...
Orsu's user avatar
  • 113
1 vote
2 answers
105 views

Measurement elements [closed]

Do you know how I can draw this and implement it in an electrical circuit?
Jose G Lopez's user avatar

1
2 3 4 5
196