# Y axis name rotation

**URL:** https://community.plotly.com/t/y-axis-name-rotation/513
**Category:** plotly.js
**Created:** [February 15, 2016, 11:16am UTC](https://community.plotly.com/t/y-axis-name-rotation/513 "2016-02-15T11:16:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Narghast](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/narghast/32/296_2.png) [@Narghast](https://community.plotly.com/u/Narghast)
#### Post date: [February 15, 2016, 11:16am UTC](https://community.plotly.com/t/y-axis-name-rotation/513/1 "2016-02-15T11:16:27Z")

</div>

Hello guys,  
I have a small problem. I need to know if exists a way to rotate the name of the y axis of 90 degrees in plotly js.

Thank you!

---

<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: [February 15, 2016, 2:00pm UTC](https://community.plotly.com/t/y-axis-name-rotation/513/2 "2016-02-15T14:00:54Z")

</div>

Unforunately, there is no way to rotate axis titles at the moment.

One workaround will be to remove the native axis titles and use annotations instead to label your axes.

---

<div class="post-metadata">

### Author: ![Narghast](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/narghast/32/296_2.png) [@Narghast](https://community.plotly.com/u/Narghast)
#### Post date: [February 15, 2016, 3:25pm UTC](https://community.plotly.com/t/y-axis-name-rotation/513/3 "2016-02-15T15:25:10Z")

</div>

i can’t figure how to put a annotation on axis. There are a lot of examples for data value but for the axis how it’s work?

Thank you.

---

<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: [February 15, 2016, 3:47pm UTC](https://community.plotly.com/t/y-axis-name-rotation/513/4 "2016-02-15T15:47:02Z")

</div>

You’re right we don’t have any example of paper-referenced annotations on [https://plot.ly/javascript/text-and-annotations/](https://plot.ly/javascript/text-and-annotations/). Thanks for the headsup!

Here’s an example that should help get started: [http://codepen.io/etpinard/pen/zrbwRx](http://codepen.io/etpinard/pen/zrbwRx)

---

<div class="post-metadata">

### Author: ![Narghast](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/narghast/32/296_2.png) [@Narghast](https://community.plotly.com/u/Narghast)
#### Post date: [February 16, 2016, 10:25am UTC](https://community.plotly.com/t/y-axis-name-rotation/513/5 "2016-02-16T10:25:09Z")

</div>

I have changed the plugin. If someone is interested i have done this changes

`else if(axletter==='y'){ ya = cont; xa = (ya.anchor==='free') ? {_offset:gs.l+(ya.position||0)*gs.w, _length:0} : Plotly.Axes.getFromId(gd, ya.anchor); y = ya._offset+ya._length/2 + 10; //added +10 for shift the label downside x = xa._offset + ((ya.side==='right') ? xa._length + 10 + fontSize*(offsetBase + (ya.showticklabels ? 1 : 0.5)) : -10 - fontSize*(offsetBase + (ya.showticklabels ? 0.5 : 0))); options = {x: x, y: y, 'text-anchor': 'middle'}; transform = {rotate: '0', offset: 0}; // CHANGE HERE rotate changed from -90 to 0 if(!avoid.side) { avoid.side = 'left'; } }`

I have changed the propriety transform rotate to 0 and added a +10 offset of the label.

---

<div class="post-metadata">

### Author: ![gourneau](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/gourneau/32/444_2.png) [@gourneau](https://community.plotly.com/u/gourneau)
#### Post date: [July 27, 2016, 8:14pm UTC](https://community.plotly.com/t/y-axis-name-rotation/513/6 "2016-07-27T20:14:37Z")

</div>

For anyone trying to rotate your annotations just use use [textangle](https://plot.ly/javascript/reference/#layout-annotations-textangle)

Here is an example:  
https://codepen.io/gourneau/embed/preview/JKkvoG?height=300&slug-hash=JKkvoG&default-tabs=js,result&host=https://codepen.io&embed-version=2

---

<div class="post-metadata">

### Author: ![mattz](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mattz](https://community.plotly.com/u/mattz)
#### Post date: [April 20, 2017, 3:59pm UTC](https://community.plotly.com/t/y-axis-name-rotation/513/7 "2017-04-20T15:59:45Z")

</div>

I managed to rotate and move y-axes titles by adding this to my css:

```
.infolayer [class^='y'][class$='title'] {
  transform: rotate(0deg) translate(30px, 135px);
}

```

hope this helps 🙂
