# How to set xtick names in Gadfly plots?

**URL:** <https://discourse.julialang.org/t/how-to-set-xtick-names-in-gadfly-plots/30795>\
**Category:** Visualization\
**Created:** [November 6, 2019, 2:11pm UTC](https://discourse.julialang.org/t/how-to-set-xtick-names-in-gadfly-plots/30795 "2019-11-06T14:11:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rio](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rio](https://discourse.julialang.org/u/rio)\
**Post date:** [November 6, 2019, 2:11pm UTC](https://discourse.julialang.org/t/how-to-set-xtick-names-in-gadfly-plots/30795/1 "2019-11-06T14:11:47Z")

</div>

Hi all,

I would like to see letters A,B,C,D in the xticks positions of the plot example below. Please, how cold I set this?

```julia
using Gadfly, Random
set_default_plot_size(14cm, 8cm)
Random.seed!(1234)
plot(x=rand(10), y=rand(10), Stat.xticks(ticks=[0.0, 0.1, 0.9, 1.0]), Geom.point)

```

Thank you for your time and help

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [November 6, 2019, 2:20pm UTC](https://discourse.julialang.org/t/how-to-set-xtick-names-in-gadfly-plots/30795/2 "2019-11-06T14:20:50Z")

</div>

You can use the `labels` option in `Scale.x_continuous` to overwrite the labels :

```julia
xticks = [0.0, 0.1, 0.9, 1.0]
labels = Dict(zip(xticks, ["A","B","C","D"]))

plot(
    x = rand(10), y = rand(10), 
    Stat.xticks(ticks = xticks),
    Scale.x_continuous(labels = x -> labels[x]),
    Geom.point
)

```
