Questions tagged [pgf]

PGF (Portable Graphics Format) is a plat­form- and for­mat-in­de­pen­dent macro pack­age for cre­at­ing graph­ics. It works to­gether with the most im­por­tant TeX back-end drivers and it comes with a user-friendly syn­tax layer called TikZ.

PGF (Portable Graphics Format) is a plat­form- and for­mat-in­de­pen­dent macro pack­age for cre­at­ing graph­ics. It works to­gether with the most im­por­tant TeX back-end drivers, in­clud­ing pdf­tex and dvips. It comes with a user-friendly syn­tax layer called TikZ.

PGF works with plain (pdf-)TEX, (pdf-)LATEX, and ConTEXt, and it can pro­duce either PostScript or PDF out­put.

Homepage: https://sourceforge.net/projects/pgf/.

Manual (v. 3.0.0): http://ctan.mirror.garr.it/mirrors/CTAN/graphics/pgf/base/doc/pgfmanual.pdf.

92 questions
3
votes
2 answers

Trees and macros with tikz

I am trying to build my trees using macros but I don't get the result I want. Here is a minimal example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \newcommand{\LeafNode}[1]{% child {node …
Tsf
  • 1,339
  • 5
  • 17
  • 29
3
votes
1 answer

Blurry text in PNG image converted from PDF via TikZ and standalone package

I've got a problem converting a pdflatex-generated PDF image to a PNG image using the standalone package. The pixelated rendering of the text in the converted image (PDF->PS->PNG via gs and ImageMagick?) is awfully blurry and inferior in quality…
svenpables
  • 99
  • 1
  • 9
2
votes
0 answers

How to remove excess whitespace in matplotlib legend for PGF plot

I'm creating a fairly small plot with matplotlib which needs to include a certain legend. However, while space is tight, for some reason matplotlib makes the legend excessively wide, adding a lot of whitespace to the right part of the legend: Is…
Wout12345
  • 91
  • 5
2
votes
1 answer

Simultaneously iterating through multiple "lists" in LaTeX

The pgffor package in LaTeX allows for looping through commands which contain "listlike" information. As mentioned in section 88 of the pgf manual, the pgffor package also allows for iterating simultaneously through two sets of "listlike"…
user32882
  • 5,094
  • 5
  • 43
  • 82
2
votes
1 answer

pie chart from csv file in LaTeX and pgf-pie

I am trying to draw a pie chart from a csv file using pgf-pie. And it must be pdf-pie, because datapie does not work for me under Debian 11. It did work under Debian 10. So I'm trying pgf-pie and I'm not interested in other solutions with other…
B. A. Sylla
  • 419
  • 3
  • 13
2
votes
1 answer

pgf/tikz: How to calculate half distance between the x coordinates?

I am trying to create a new node type like this: http://www.live-wtr.ru/leo/Tikz9.png but don't understand, how to calculate x3 = x1 + (x2 - x1) /2 Here I tried to do it, but in vain. \pgfdeclareshape{variant}{…
user4035
  • 22,508
  • 11
  • 59
  • 94
2
votes
0 answers

Matplotlib Output Legend box has wrong size in PGF output

currently, I'm struggling with an odd problem which occurs when exporting a matplotlib figure to PGF. As seen in the screenshot (from my LaTeX document), the output has a corrupted legend box, see fig. 1, which is too small. However,…
PascalB
  • 21
  • 2
2
votes
1 answer

matplotlib PGF output: Contour labels extend beyond figure boundary

Taking the first example from the matplotlib examples page, import matplotlib import numpy as np import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt matplotlib.rcParams['xtick.direction'] =…
Socob
  • 1,189
  • 1
  • 12
  • 26
2
votes
1 answer

Reducing the output file size of tikzDevice

I'm writing a large latex document with lots of plots generated by R's tikzDevice package. Currently, I'm experiencing LaTeX error "TeX capacity exceeded". I've managed to fix this issue temporarily by following the remedy from Leo Liu's answer…
2
votes
1 answer

Incorrect alignment of nodes in subpictures

I am using tikz to typeset a diagram in a latex document. I have a grid of 'grid-diagrams', with each grid-diagram drawn as a separate tikz picture and then arranged into the grid as nodes. I want to draw a circle node (which will eventually…
Tom Close
  • 620
  • 5
  • 12
1
vote
0 answers

Python (tikzplotlib) to LaTex: Package PGF Math Error: Could not parse input '--'

I am currently having some issues creating diagrams for LaTex using tikzplotlib in python. The string created with tikzplotlib contains characters that cannot be processed by latex. Here is a sample output from tikzplotlib: \addplot [draw=black,…
Hendrik
  • 11
  • 1
1
vote
0 answers

matplotlib pgf backend – adjusting preamble

Consider the following piece of code: import matplotlib as mpl mpl.use("pgf") preamble = r'\usepackage{newtxtext,newtxmath}' mpl.rcParams.update({ "pgf.texsystem": 'lualatex', "pgf.preamble": preamble, 'text.latex.preamble': preamble, …
Bubaya
  • 615
  • 3
  • 13
1
vote
0 answers

How can I write code to be executed in interactive mode?

My problem is similar to the one that is treated [here]:(How can I check if code is executed in the IPython notebook?), but with an additional layer. I am using some .py scripts with the special comment "# %%" that in visual studio code allow me to…
1
vote
0 answers

Irregular font using Matplotlib with pgf backend

I am getting these irregular fonts when plotting with pgf backend. Irregular Fonts import matplotlib.pyplot as plt import numpy as np x = np.arange(-3,3,0.1) def f(x): return x**3 plt.style.use(['seaborn-v0_8-darkgrid',…
Gabriel
  • 11
  • 1
1
vote
0 answers

How do I send the result of \pgfkeys to Lua?

In the example below the macro "\pgfkeysprintvalue" is a variant of "\pgfkeysgetvalue" that sort of sends the value of a key to Lua, and prints it from…