# \#pgfplotsx

**URL:** https://discourse.julialang.org/tag/pgfplotsx/529.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Question about PGFPlotsX.jl](https://discourse.julialang.org/t/question-about-pgfplotsx-jl/81815)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 10\
**Last updated:** [July 27, 2026, 2:55pm UTC](https://discourse.julialang.org/t/question-about-pgfplotsx-jl/81815 "2026-07-27T14:55:49Z")

</div>

What’s wrong with this, I have installed LaTeX in my Mac M1. julia\> using PGFPlotsX julia\> pgfplotsx() Plots.PGFPlotsXBackend() julia\> surface(range(-3, 3, length = 30), range(-3, 3, length = 30), (x, y)…

---

## [How to make a heatmap with pgfplotsx?](https://discourse.julialang.org/t/how-to-make-a-heatmap-with-pgfplotsx/75128)

<div class="topic-metadata">

**Author:** [@ccmejia](https://discourse.julialang.org/u/ccmejia)\
**Replies:** 4\
**Last updated:** [June 27, 2026, 2:08pm UTC](https://discourse.julialang.org/t/how-to-make-a-heatmap-with-pgfplotsx/75128 "2026-06-27T14:08:07Z")

</div>

Hi there! Which is the straightforward pgfplotsx way to make heatmap figure? For Plots is so easy: V = rand(20, 20) heatmap(V) Thanks in advanced!

---

## [Modify axis options when using Plots.jl with pgfplotsx backend](https://discourse.julialang.org/t/modify-axis-options-when-using-plots-jl-with-pgfplotsx-backend/121292)

<div class="topic-metadata">

**Author:** [@lcm](https://discourse.julialang.org/u/lcm)\
**Replies:** 3\
**Last updated:** [April 26, 2026, 4:31pm UTC](https://discourse.julialang.org/t/modify-axis-options-when-using-plots-jl-with-pgfplotsx-backend/121292 "2026-04-26T16:31:33Z")

</div>

I am using Plots.jl with the pgfplotsx() backend for emitting .tikz files. Together with the tikzscale LaTeX package this makes for nice plots for a TeX document. However, in the emitted plots there are a lot of options…

---

## [How to add \`PGFPlotsX.Coordinates()\` object to raw LaTeX command?](https://discourse.julialang.org/t/how-to-add-pgfplotsx-coordinates-object-to-raw-latex-command/133070)

<div class="topic-metadata">

**Author:** [@tapyu](https://discourse.julialang.org/u/tapyu)\
**Replies:** 0\
**Last updated:** [October 11, 2025, 2:26pm UTC](https://discourse.julialang.org/t/how-to-add-pgfplotsx-coordinates-object-to-raw-latex-command/133070 "2025-10-11T14:26:48Z")

</div>

\#!/usr/bin/env julia # using Pkg; Pkg.add("PGFPlotsX") # run once using PGFPlotsX empty!(PGFPlotsX.CUSTOM\_PREAMBLE) push!(PGFPlotsX.CUSTOM\_PREAMBLE, raw"\\usetikzlibrary{calc,spy}") origin = PGFPlotsX.Coordinate(0, 0)…

---

## [Setting aspect ratio in Plots with PGFPlotsX](https://discourse.julialang.org/t/setting-aspect-ratio-in-plots-with-pgfplotsx/103424)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 1\
**Last updated:** [April 5, 2025, 10:25am UTC](https://discourse.julialang.org/t/setting-aspect-ratio-in-plots-with-pgfplotsx/103424 "2025-04-05T10:25:49Z")

</div>

What I want is to set the aspect ratio to 1 when plotting with Plots.jl and PGFPlotsX backend. My plotting script looks like this: ε\_min = -1.5 ε\_max = 1 kpt\_labels = \[L"-\\mathrm{Y}", L"\\Gamma", L"\\mathrm{Y}"\] kpt\_pos …

---

## [How to fix "! Dimension too large." when using pgfplotsx?](https://discourse.julialang.org/t/how-to-fix-dimension-too-large-when-using-pgfplotsx/126730)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 1\
**Last updated:** [March 9, 2025, 1:08pm UTC](https://discourse.julialang.org/t/how-to-fix-dimension-too-large-when-using-pgfplotsx/126730 "2025-03-09T13:08:19Z")

</div>

When trying to plot the following data VectorOfArray{Float64,2}: 2-element Vector{Vector{Float64}}: \[0.00969160836699929, 516.6666666666663\] \[0.00974104323961814, 900.0\] VectorOfArray{Float64,2}: 2-element Vector{Vect…

---

## [How to use amssymb in Plots.jl with LaTeXStrings?](https://discourse.julialang.org/t/how-to-use-amssymb-in-plots-jl-with-latexstrings/126728)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 0\
**Last updated:** [March 9, 2025, 12:14pm UTC](https://discourse.julialang.org/t/how-to-use-amssymb-in-plots-jl-with-latexstrings/126728 "2025-03-09T12:14:28Z")

</div>

How to use amssymb commands in L"..."-labels of plots? Using, for example, \\mathbb returns the following error: ! Undefined control sequence. \\pgfplots@already@computed@legend@node ...\\mathbb …

---

## [How to save Plots.jl with pgfplotsx() without dimensions and other properties?](https://discourse.julialang.org/t/how-to-save-plots-jl-with-pgfplotsx-without-dimensions-and-other-properties/112158)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 1\
**Last updated:** [January 24, 2025, 11:31am UTC](https://discourse.julialang.org/t/how-to-save-plots-jl-with-pgfplotsx-without-dimensions-and-other-properties/112158 "2025-01-24T11:31:10Z")

</div>

Plots.jl saves pgfplotsx() figures like this: ... width={150.4mm}, height={99.6mm}, xlabel style={...}, ylabel style={...}, ... How do I prevent these properties from being written to the file?

---

## [Plots.jl : positioning and scaling of "annotate!"](https://discourse.julialang.org/t/plots-jl-positioning-and-scaling-of-annotate/11290)

<div class="topic-metadata">

**Author:** [@Rob\_van\_Weelderen](https://discourse.julialang.org/u/Rob_van_Weelderen)\
**Replies:** 8\
**Last updated:** [August 30, 2024, 5:46pm UTC](https://discourse.julialang.org/t/plots-jl-positioning-and-scaling-of-annotate/11290 "2024-08-30T17:46:03Z")

</div>

I would like to put on the lower right corner of my plots a notification text string, typically citing the the “data source : date of production” Although I can put text using annotate!(xpos, ypos, "my text", :color) i…

---

## [Plots.jl custom linestyle: longer dashes](https://discourse.julialang.org/t/plots-jl-custom-linestyle-longer-dashes/117772)

<div class="topic-metadata">

**Author:** [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Replies:** 9\
**Last updated:** [August 8, 2024, 6:47am UTC](https://discourse.julialang.org/t/plots-jl-custom-linestyle-longer-dashes/117772 "2024-08-08T06:47:16Z")

</div>

I would like to insist whether there is a way to make a customized dash for the linestyle of Plots.jl, by choosing its length and the gap length as well among the dashes. There is a similar topic under Longer dashes in d…

---

## [How to use amsmath/mathtools in Plots.jl?](https://discourse.julialang.org/t/how-to-use-amsmath-mathtools-in-plots-jl/111542)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 9:12am UTC](https://discourse.julialang.org/t/how-to-use-amsmath-mathtools-in-plots-jl/111542 "2024-03-13T09:12:33Z")

</div>

How can I use amsmath or mathtools commands in Plots.jl? Neither GR + LaTeXStrings.jl nor PGFPlotsX.jl recognize commands like \\lVert A \\rVert

---

## [PGFPlots Healpix / Mollweide / Aitoff projections?](https://discourse.julialang.org/t/pgfplots-healpix-mollweide-aitoff-projections/106832)

<div class="topic-metadata">

**Author:** [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Replies:** 1\
**Last updated:** [March 12, 2024, 6:24pm UTC](https://discourse.julialang.org/t/pgfplots-healpix-mollweide-aitoff-projections/106832 "2024-03-12T18:24:41Z")

</div>

I really like PGFPlotsX.jl to create plots which seamlessly integrate into papers but I now I need to make a bunch of Healpix Mollweide projections to visualise data spread on the surface on a sphere (essentially skymaps…

---

## [Save plot as .tex file](https://discourse.julialang.org/t/save-plot-as-tex-file/108691)

<div class="topic-metadata">

**Author:** [@flobe](https://discourse.julialang.org/u/flobe)\
**Replies:** 6\
**Last updated:** [January 12, 2024, 9:31am UTC](https://discourse.julialang.org/t/save-plot-as-tex-file/108691 "2024-01-12T09:31:08Z")

</div>

Hi all, I’m trying to export my plot in Julia as a pgf plot. So basically I want a .tex file with the data, the header, etc. automatically generated from the plot. However I’m not sure how to do it correctly. Currently …

---

## [Error showing value of type TikzPicture: The latex command \`lualatex' failed](https://discourse.julialang.org/t/error-showing-value-of-type-tikzpicture-the-latex-command-lualatex-failed/105894)

<div class="topic-metadata">

**Author:** [@gonshem](https://discourse.julialang.org/u/gonshem)\
**Replies:** 1\
**Last updated:** [November 7, 2023, 4:19pm UTC](https://discourse.julialang.org/t/error-showing-value-of-type-tikzpicture-the-latex-command-lualatex-failed/105894 "2023-11-07T16:19:23Z")

</div>

Hello everyone, I am encountering an issue while using the PGFPlotsX package in Julia to generate a TikzPicture. I am getting an error message that says “The LaTeX command lualatex jl\_u5wvs7aPQN.tex failed.” The code: …

---

## [Question about PGFPlotsX](https://discourse.julialang.org/t/question-about-pgfplotsx/105295)

<div class="topic-metadata">

**Author:** [@Isaac\_Smith](https://discourse.julialang.org/u/Isaac_Smith)\
**Replies:** 1\
**Last updated:** [October 23, 2023, 9:00am UTC](https://discourse.julialang.org/t/question-about-pgfplotsx/105295 "2023-10-23T09:00:06Z")

</div>

In the Plots.jl documentation about the PGFPlotsX backend, they mention how exporting the plot as a tikzpicture allows the user to rescale the plot using \\includegraphics, but I am not quite understanding how you would d…

---

## [Modify position of axis labels in a PGFPlotsX created with plot()](https://discourse.julialang.org/t/modify-position-of-axis-labels-in-a-pgfplotsx-created-with-plot/100425)

<div class="topic-metadata">

**Author:** [@andresdrenik](https://discourse.julialang.org/u/andresdrenik)\
**Replies:** 0\
**Last updated:** [June 15, 2023, 10:41pm UTC](https://discourse.julialang.org/t/modify-position-of-axis-labels-in-a-pgfplotsx-created-with-plot/100425 "2023-06-15T22:41:19Z")

</div>

Hi, I’m creating the attached figure with pgfplotsx() p1 = plot(𝕊.Ŵ,𝕊.Ĵ, label = "Efficiency", color = 3, linestyle=:dash, legend = :topright, xguide = L"\\hat{W}(\\hat{w})", yguide = L"\\hat{J}(\\hat{w})") #, xguidefontval…

---

## [Odd error for contour plots with PGFPlotsX](https://discourse.julialang.org/t/odd-error-for-contour-plots-with-pgfplotsx/99670)

<div class="topic-metadata">

**Author:** [@theo](https://discourse.julialang.org/u/theo)\
**Replies:** 0\
**Last updated:** [May 31, 2023, 12:17pm UTC](https://discourse.julialang.org/t/odd-error-for-contour-plots-with-pgfplotsx/99670 "2023-05-31T12:17:40Z")

</div>

So some of my contour plots with PGFPlotsX are breaking, others are not. I tried to find a simple way to reproduce the error and realised it breaks if I try to plot anything that’s flat… Can anyone explain this? julia\> …

---

## [PGFPlotsX invalid pgf key error](https://discourse.julialang.org/t/pgfplotsx-invalid-pgf-key-error/98839)

<div class="topic-metadata">

**Author:** [@keynescoefen](https://discourse.julialang.org/u/keynescoefen)\
**Replies:** 3\
**Last updated:** [May 15, 2023, 5:20pm UTC](https://discourse.julialang.org/t/pgfplotsx-invalid-pgf-key-error/98839 "2023-05-15T17:20:53Z")

</div>

Hello! When running Version 1.9.0 (2023-05-07) with the latest PGFPlotsX the following snippet gives me this error message. When using the generic plotting functions like so, I get the error message further below. usi…

---

## [Plots.jl with PGFPlotsX backend produces plot way of center](https://discourse.julialang.org/t/plots-jl-with-pgfplotsx-backend-produces-plot-way-of-center/97678)

<div class="topic-metadata">

**Author:** [@TheBigZet](https://discourse.julialang.org/u/TheBigZet)\
**Replies:** 2\
**Last updated:** [April 20, 2023, 6:55am UTC](https://discourse.julialang.org/t/plots-jl-with-pgfplotsx-backend-produces-plot-way-of-center/97678 "2023-04-20T06:55:50Z")

</div>

This simple Julia code: using Plots; pgfplotsx(); using LaTeXStrings x = \[-243, 144, 243\] e1 = \[120, 149, 26\] e2 = \[218, 271, 68\] e3 = \[314, 380, 148\] function plot\_eps(p, x, y, color, label) plot!(p, x, y, label …

---

## [How to control legend position with PGFPlotsX](https://discourse.julialang.org/t/how-to-control-legend-position-with-pgfplotsx/14018)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 10\
**Last updated:** [February 18, 2023, 11:53am UTC](https://discourse.julialang.org/t/how-to-control-legend-position-with-pgfplotsx/14018 "2023-02-18T11:53:18Z")

</div>

If I do @pgf p = Axis({ xlabel = "Distance \[m\]", ylabel = "Temperature \[degree Kelvin\]", title = "", legend = "pos south east" }, …

---

## [How do I add a group title to PGFPlotsX?](https://discourse.julialang.org/t/how-do-i-add-a-group-title-to-pgfplotsx/94828)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 0\
**Last updated:** [February 18, 2023, 10:41am UTC](https://discourse.julialang.org/t/how-do-i-add-a-group-title-to-pgfplotsx/94828 "2023-02-18T10:41:16Z")

</div>

Hello! Suppose I have the code from the doc, https://kristofferc.github.io/PGFPlotsX.jl/stable/examples/axislike/: x = range(0; stop =2\*pi, length = 100) @pgf GroupPlot( { group\_style = { …

---

## [PGFPlotsX.jl boxplot](https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 8:24am UTC](https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047 "2023-01-17T08:24:46Z")

</div>

Hi, I was wondering if there is a way to get overlay a line chart on top of a boxplot in PGFPlotsX.jl (something like this). Has anyone tried that before?

---

## [Pgfplotsx with \\mathbb](https://discourse.julialang.org/t/pgfplotsx-with-mathbb/92747)

<div class="topic-metadata">

**Author:** [@Elyco](https://discourse.julialang.org/u/Elyco)\
**Replies:** 2\
**Last updated:** [January 10, 2023, 10:21am UTC](https://discourse.julialang.org/t/pgfplotsx-with-mathbb/92747 "2023-01-10T10:21:10Z")

</div>

Hi, I’m trying to put a latex label \\mathbb{R} with pgfplotsx() backend. But I get an error: using Plots using LaTeXStrings pgfplotsx() plot(rand(10), label=L"\\mathcal{R}^{2N}") |\> display # works! plot(rand(10), labe…

---

## [Adding pdf/png into existing pgfplots](https://discourse.julialang.org/t/adding-pdf-png-into-existing-pgfplots/89922)

<div class="topic-metadata">

**Author:** [@Elyco](https://discourse.julialang.org/u/Elyco)\
**Replies:** 2\
**Last updated:** [November 8, 2022, 3:46pm UTC](https://discourse.julialang.org/t/adding-pdf-png-into-existing-pgfplots/89922 "2022-11-08T15:46:52Z")

</div>

Hi, I’m trying to add a node to a pgfplot that contains a pdf/png file. Here is what I have until now using Plots pgfplotsx() fig1 = plot(1:5) savefig(fig1, "fig1.png") savefig(fig1, "fig1.pdf") # just to create a fig…

---

## [Default length unit with PGFPlotsX and Plots](https://discourse.julialang.org/t/default-length-unit-with-pgfplotsx-and-plots/88367)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 3\
**Last updated:** [October 7, 2022, 12:40pm UTC](https://discourse.julialang.org/t/default-length-unit-with-pgfplotsx-and-plots/88367 "2022-10-07T12:40:56Z")

</div>

I am using PGFPlotsX as a backend for Plots. I have specified the plot width as 800. After I saved the plot to pdf and inspected the properties, the width seems to be 194mm, which is around 550 pt. What are the default …

---

## [Access lualatex log with PGFPlotsX](https://discourse.julialang.org/t/access-lualatex-log-with-pgfplotsx/88355)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 4\
**Last updated:** [October 6, 2022, 6:35pm UTC](https://discourse.julialang.org/t/access-lualatex-log-with-pgfplotsx/88355 "2022-10-06T18:35:17Z")

</div>

I am trying to use PGFPlotsX together with Plots, and I get the following error: The latex command \`lualatex jl\_ODVl4Y.tex\` failed How do I access the lualatex log itself to understand what is going on?

---

## [Save a figure with a specific size with a subplot of a specific size in Plots.jl (with PGFPlotsX backend)](https://discourse.julialang.org/t/save-a-figure-with-a-specific-size-with-a-subplot-of-a-specific-size-in-plots-jl-with-pgfplotsx-backend/86614)

<div class="topic-metadata">

**Author:** [@JonasWickman](https://discourse.julialang.org/u/JonasWickman)\
**Replies:** 2\
**Last updated:** [September 1, 2022, 3:02pm UTC](https://discourse.julialang.org/t/save-a-figure-with-a-specific-size-with-a-subplot-of-a-specific-size-in-plots-jl-with-pgfplotsx-backend/86614 "2022-09-01T15:02:54Z")

</div>

In PyPlot, I can output a figure with a specific size containing an axis in the figure with a specific size using the code: using PyPlot fig\_width = 4.0 fig\_height = 3.0 fig = figure( figsize = (fig\_width, fig\_height) )…

---

## [Plots.jl with PGFPlotsX adds series in the wrong order](https://discourse.julialang.org/t/plots-jl-with-pgfplotsx-adds-series-in-the-wrong-order/85896)

<div class="topic-metadata">

**Author:** [@Joseph\_Bradley](https://discourse.julialang.org/u/Joseph_Bradley)\
**Replies:** 2\
**Last updated:** [August 17, 2022, 9:23pm UTC](https://discourse.julialang.org/t/plots-jl-with-pgfplotsx-adds-series-in-the-wrong-order/85896 "2022-08-17T21:23:17Z")

</div>

In Plots.jl, the PGFPlotsX backend won’t let me add another series with proper control over the z-order. Here is the MWE: using Plots pgfplotsx() input = range(0, 4π, 100) output = cos.(input) plt = scatter(input, out…

---

## [PGFPlots or PGFPlotsX with Docker](https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363)

<div class="topic-metadata">

**Author:** [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)\
**Replies:** 3\
**Last updated:** [June 19, 2022, 8:45pm UTC](https://discourse.julialang.org/t/pgfplots-or-pgfplotsx-with-docker/82363 "2022-06-19T20:45:03Z")

</div>

Dear @kristoffer.carlsson I’m currently used to compile latex code within a docker container. The question is, how difficult would it be to have an option for producing the figures with a Docker image instead of using a…

---

## [Cannot change colorbar position](https://discourse.julialang.org/t/cannot-change-colorbar-position/17181)

<div class="topic-metadata">

**Author:** [@shipengcheng1230](https://discourse.julialang.org/u/shipengcheng1230)\
**Replies:** 6\
**Last updated:** [May 1, 2022, 9:13am UTC](https://discourse.julialang.org/t/cannot-change-colorbar-position/17181 "2022-05-01T09:13:13Z")

</div>

I am trying to change the colorbar position: using Plots # pyplot() plot(rand(10, 2), marker\_z=rand(10), seriestype=:scatter, cb=:top) But the colorbar position won’t move no matter how I specifiy :cb: It is always …

[Next page](https://discourse.julialang.org/tag/pgfplotsx/529.md?match_all_tags=true&page=1&tags%5B%5D=pgfplotsx)
