# Updating the X axis labels

**URL:** https://community.plotly.com/t/updating-the-x-axis-labels/9082
**Category:** plotly.js
**Created:** [March 20, 2018, 10:57am UTC](https://community.plotly.com/t/updating-the-x-axis-labels/9082 "2018-03-20T10:57:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lcl](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/lcl/32/2801_2.png) [@lcl](https://community.plotly.com/u/lcl)
#### Post date: [March 20, 2018, 10:57am UTC](https://community.plotly.com/t/updating-the-x-axis-labels/9082/1 "2018-03-20T10:57:06Z")

</div>

Hi, I created a simple code example of my issue: [http://jsbin.com/xogapupoca/edit?html,js,console,output](http://jsbin.com/xogapupoca/edit?html,js,console,output)

It creates a couple of series and then tries to update the following things:

- The chart title (working)
- The marker color (not working)
- The x axis labels (not working)

Am I fundamentally misunderstanding the update function? I’m basically just replacing the original data array with a new one.

Thanks in advance for any suggestions.

Luis

---

<div class="post-metadata">

### Author: ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)
#### Post date: [March 20, 2018, 1:51pm UTC](https://community.plotly.com/t/updating-the-x-axis-labels/9082/2 "2018-03-20T13:51:55Z")

</div>

Here’s a working version:

> **[JS Bin](http://jsbin.com/haxuxaqolo/edit?html,js,console,output)**
>
> A live pastebin for HTML, CSS & JavaScript and a range of processors, including SCSS, CoffeeScript, Jade and more...

In brief, `Plotly.update` **does not** expect new traces and new layout object, it expects key-value update pairs. See [https://plot.ly/javascript/plotlyjs-function-reference/#plotlyrestyle](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyrestyle) for more info.

---

<div class="post-metadata">

### Author: ![lcl](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/lcl/32/2801_2.png) [@lcl](https://community.plotly.com/u/lcl)
#### Post date: [March 20, 2018, 2:10pm UTC](https://community.plotly.com/t/updating-the-x-axis-labels/9082/3 "2018-03-20T14:10:28Z")

</div>

Awesome, it makes sense now 😅, thanks for the quick reply 🙌
