# Extracting xticks from a plot handle

**URL:** <https://discourse.julialang.org/t/extracting-xticks-from-a-plot-handle/56183>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [February 28, 2021, 11:46am UTC](https://discourse.julialang.org/t/extracting-xticks-from-a-plot-handle/56183 "2021-02-28T11:46:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matvil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matvil/32/15727_2.png) [@matvil](https://discourse.julialang.org/u/matvil)\
**Post date:** [February 28, 2021, 11:46am UTC](https://discourse.julialang.org/t/extracting-xticks-from-a-plot-handle/56183/1 "2021-02-28T11:46:20Z")

</div>

I would like to extract the vector of xticks values from a plot. I am using the GR backend.

For xlim I can do this:

h = plot(randn(10))  
xlims(h) # returns a tuple with the two limits  
xlims!(h, (-10,10)) # modifies xlims in the plot

I can modify the xticks using the same syntax:  
xticks!(h,[-5,0,5]) # works

But I can not extract xticks from the handle:  
xticks(h) # returns ERROR: UndefVarError: xticks not defined

Is this a bug, or am I missing some logic in this?
