# Plotting a matrix with wireframe where one axis isn't 1:max

**URL:** <https://discourse.julialang.org/t/plotting-a-matrix-with-wireframe-where-one-axis-isnt-1-max/109316>\
**Category:** Visualization\
**Tags:** plots\
**Created:** [January 26, 2024, 7:28pm UTC](https://discourse.julialang.org/t/plotting-a-matrix-with-wireframe-where-one-axis-isnt-1-max/109316 "2024-01-26T19:28:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwanab](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bwanab/32/35903_2.png) [@bwanab](https://discourse.julialang.org/u/bwanab)\
**Post date:** [January 26, 2024, 7:28pm UTC](https://discourse.julialang.org/t/plotting-a-matrix-with-wireframe-where-one-axis-isnt-1-max/109316/1 "2024-01-26T19:28:16Z")

</div>

I’m plotting a matrix in which the interpretation of one axis isn’t the 1:n where n is size of the axis.

For example:

```julia
using Plots

data = reshape(rand(9), 3,3)
p = wireframe(data) # works fine with both axis 1:3
xticks!(p, 11:13) # the axis disappears

```

How can I get the xaxis to show 11,12,13 instead of 1,2,3?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [January 26, 2024, 7:36pm UTC](https://discourse.julialang.org/t/plotting-a-matrix-with-wireframe-where-one-axis-isnt-1-max/109316/2 "2024-01-26T19:36:14Z")

</div>

```julia
p = wireframe(data; xticks=(1:3, 11:13))

```

---

<div class="post-metadata">

**Author:** ![lepton01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lepton01/32/48824_2.png) [@lepton01](https://discourse.julialang.org/u/lepton01)\
**Post date:** [January 26, 2024, 7:43pm UTC](https://discourse.julialang.org/t/plotting-a-matrix-with-wireframe-where-one-axis-isnt-1-max/109316/3 "2024-01-26T19:43:48Z")

</div>

And also, instead of reshaping a 9 rand vector, you can just do `rand(3,3)`.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 26, 2024, 7:56pm UTC](https://discourse.julialang.org/t/plotting-a-matrix-with-wireframe-where-one-axis-isnt-1-max/109316/4 "2024-01-26T19:56:44Z")

</div>

Providing the axes to start with is the easiest way:

```julia
wireframe(11:13, 1:3, data)

```

---

<div class="post-metadata">

**Author:** ![bwanab](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bwanab/32/35903_2.png) [@bwanab](https://discourse.julialang.org/u/bwanab)\
**Post date:** [January 26, 2024, 10:42pm UTC](https://discourse.julialang.org/t/plotting-a-matrix-with-wireframe-where-one-axis-isnt-1-max/109316/5 "2024-01-26T22:42:27Z")

</div>

Thanks, all! Still learning.
