# Plots: absolute position of axis endpoints?

**URL:** <https://discourse.julialang.org/t/plots-absolute-position-of-axis-endpoints/90055>\
**Category:** Visualization\
**Tags:** question, plotting\
**Created:** [November 10, 2022, 2:45pm UTC](https://discourse.julialang.org/t/plots-absolute-position-of-axis-endpoints/90055 "2022-11-10T14:45:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [November 10, 2022, 2:45pm UTC](https://discourse.julialang.org/t/plots-absolute-position-of-axis-endpoints/90055/1 "2022-11-10T14:45:56Z")

</div>

As I understand, the `size` attribute fixes the physical size of the canvas. (Sorry I don’t know the proper terminology.) But, I wonder how to fix the physical positions of the endpoints of the axes.

I’m producing a set of line graphs for which the horizontal axis is exactly the same but the vertical axis differs from figure to figure:

```julia
  using Plots
  savefig(plot(xs, ys1; size = . . . ), "figure1.pdf")
  savefig(plot(xs, ys2; size = . . . ), "figure2.pdf")
  # . . .

```

Because the labels on the vertical axis differs from figure to figure, the physical length of the x axis varies from figure to figure. How can one fix the physical length of the x axis? I don’t mind there is spurious space near the left edge of the figure.

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [November 10, 2022, 3:15pm UTC](https://discourse.julialang.org/t/plots-absolute-position-of-axis-endpoints/90055/2 "2022-11-10T15:15:05Z")

</div>

Using the pgfplotsx backend you might get what you are looking for.  
Compare: [Outer legend positions · Plots](https://docs.juliaplots.org/stable/gallery/gr/generated/gr-ref65/#gr_demo_65) and [Outer legend positions · Plots](https://docs.juliaplots.org/stable/gallery/pgfplotsx/generated/pgfplotsx-ref65/#pgfplotsx_demo_65)

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [November 11, 2022, 12:04pm UTC](https://discourse.julialang.org/t/plots-absolute-position-of-axis-endpoints/90055/3 "2022-11-11T12:04:09Z")

</div>

I wonder what usage you have mind of the example in [Outer legend positions · Plots](https://docs.juliaplots.org/stable/gallery/gr/generated/gr-ref65/#gr_demo_65) . . .

In the example, the length of the x axis changes in the left and right columns because the horizontal size of the legend changes. In the middle column, the length of the x axis is fixed only because there are no elements to the left or right of the y axes.

What I need is to fix the length of the x axis regardless of what exists to the left or right of the plotting area.

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [November 11, 2022, 12:28pm UTC](https://discourse.julialang.org/t/plots-absolute-position-of-axis-endpoints/90055/4 "2022-11-11T12:28:11Z")

</div>

And thats how the pgfplotsx-backend behaves (as can be seen in [Outer legend positions · Plots](https://docs.juliaplots.org/stable/gallery/pgfplotsx/generated/pgfplotsx-ref65/#pgfplotsx_demo_65)), no?
