# Documenter generates inconsistent plots

**URL:** <https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610>\
**Category:** General Usage\
**Created:** [February 2, 2024, 10:42am UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610 "2024-02-02T10:42:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![putianyi888](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/putianyi888/32/32279_2.png) [@putianyi888](https://discourse.julialang.org/u/putianyi888)\
**Post date:** [February 2, 2024, 10:42am UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610/1 "2024-02-02T10:42:07Z")

</div>

An auto-generated plot in my package documentation is inconsistent across irrelevent commits.

The most recent [build](https://github.com/putianyi889/PseudostableRecurrences.jl/commit/80bbb08921d7c73c41eb3101b725aee5c634c683) changed the image while the related [commit](https://github.com/putianyi889/PseudostableRecurrences.jl/commit/7d21e5e95fa261c70e514aa91de1e39c539747f7) is irrelevant. Both images are different from [what I get locally](https://discourse.julialang.org/uploads/short-url/lJFWRqSP71FJuDvuqCO5kBxZmht.png).

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [February 2, 2024, 12:06pm UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610/2 "2024-02-02T12:06:19Z")

</div>

I can’t tell from your links how the images differ. But presumably, this is an issue with Plots (?), not Documenter. It’s hard to tell what exactly you’re doing, but presumably Documenter simply generates a new image every time it builds the documentation. Plots probably makes few if any guarantees on being “stable”. I would expect the platform and e.g. the installed fonts to change the output in small ways. So I would say this is expected behavior

---

<div class="post-metadata">

**Author:** ![putianyi888](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/putianyi888/32/32279_2.png) [@putianyi888](https://discourse.julialang.org/u/putianyi888)\
**Post date:** [February 2, 2024, 8:33pm UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610/3 "2024-02-02T20:33:13Z")

</div>

> [@goerz](#):
>
> I can’t tell from your links how the images differ.

There are 3 different images. [The local one](https://discourse.julialang.org/uploads/short-url/lJFWRqSP71FJuDvuqCO5kBxZmht.png), the [old workflow-generated one](https://github.com/putianyi889/PseudostableRecurrences.jl/blob/6021e2b77dbb6830082f3c90809b49d656634b45/dev/examples/151bbf28.svg) and the [new workflow-generated one](https://github.com/putianyi889/PseudostableRecurrences.jl/blob/80bbb08921d7c73c41eb3101b725aee5c634c683/dev/examples/1a71ce91.svg). The local one is perfect. The old one chops a bit on the left and the new one is far off. The fonts are the same. The platform could affect the overall looking, but I suppose they should not give glitched results?

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [February 2, 2024, 9:13pm UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610/4 "2024-02-02T21:13:40Z")

</div>

Seems like the local one in a PNG and the workflow-generated ones are SVG. So probably a different backend or different settings? Where are these plots actually being created in the documentation? (edit: never mind, found [PseudostableRecurrences.jl/docs/src/examples.md at master · putianyi889/PseudostableRecurrences.jl · GitHub](https://github.com/putianyi889/PseudostableRecurrences.jl/blob/master/docs/src/examples.md))

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [February 2, 2024, 9:17pm UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610/5 "2024-02-02T21:17:56Z")

</div>

I wonder if setting a backend explicitly would help here, or maybe [DisplayAs](https://tkf.github.io/DisplayAs.jl/dev/) (which becomes essential when you have `Literate.jl` examples).

But other than that, this might be something to open an issue for with `Plots.jl`, if you can nail it down a bit more.

---

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [February 2, 2024, 11:15pm UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610/6 "2024-02-02T23:15:09Z")

</div>

Also, you could try the solution provided here:

> [@Package documentation: the left edge of the plot is missing](https://discourse.julialang.org/t/package-documentation-the-left-edge-of-the-plot-is-missing/95348/4):
>
> I found the issue. Added the below line to the documentation.yml file. GKSwstype: "100" [Syntax · Documenter.jl (juliadocs.org)](https://documenter.juliadocs.org/stable/man/syntax/) Everything is fine now. [Functions · PortfolioAnalytics.jl (doganmehmet.github.io)](https://doganmehmet.github.io/PortfolioAnalytics.jl/dev/functions/#PortfolioAnalytics.portfolio_optimize)

---

<div class="post-metadata">

**Author:** ![putianyi888](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/putianyi888/32/32279_2.png) [@putianyi888](https://discourse.julialang.org/u/putianyi888)\
**Post date:** [February 3, 2024, 8:45am UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610/7 "2024-02-03T08:45:45Z")

</div>

> [@goerz](#):
>
> Seems like the local one in a PNG and the workflow-generated ones are SVG.

I can’t upload an SVG to the discourse, so I converted it to png.
