# Change x axis from integer-scale to pi-scale

**URL:** <https://discourse.julialang.org/t/change-x-axis-from-integer-scale-to-pi-scale/84106>\
**Category:** General Usage\
**Tags:** plots, gr\
**Created:** [July 12, 2022, 1:30pm UTC](https://discourse.julialang.org/t/change-x-axis-from-integer-scale-to-pi-scale/84106 "2022-07-12T13:30:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 12, 2022, 1:30pm UTC](https://discourse.julialang.org/t/change-x-axis-from-integer-scale-to-pi-scale/84106/1 "2022-07-12T13:30:04Z")

</div>

I want to know what is the general (can be used for backend Plotly,GR,Makie,PlotlyJS) / easiest way to change the scale from standard integer:  
-5,-4,…,0,1,2,…

**to pi-scale: -π/2. -π/4, 0,…,π/4,π/2,π,3π/2,2π**

this is my code:

```julia

using Plots, LaTeXStrings
gr()

f(x) = sin.(1/x)
#f(x) = (x^3 - 1) / (x-1)

annotate!([(30.3,23.3, ("x", 10, :black)), 
           (3.03,933.07, ("y", 10, :black))])

println("x \t sin 1/πx")

for N in 1:10:550
    g = sin.(1 / (pi*N))
    println("$N \t $g ")
end

plot(f,-10,10, label=L"\sin \frac{1}{x}", legend=:outertop)
plot!([0], seriestype="vline", color=:green, label="")
plot!([0], seriestype="hline", color=:green, label="")

```

 ![Capture d’écran_2022-07-12_20-25-56](https://global.discourse-cdn.com/julialang/original/3X/4/7/47796a0ebbc951272210dc805f4fd0696b383b4d.png)

---

<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:** [July 12, 2022, 6:00pm UTC](https://discourse.julialang.org/t/change-x-axis-from-integer-scale-to-pi-scale/84106/2 "2022-07-12T18:00:49Z")

</div>

Linking for example one solution by @genkuroki from [this other thread](https://discourse.julialang.org/t/plot-with-x-axis-in-radians-with-ticks-at-multiples-of-pi/65325/3).
