# Add axis labes in react-plotly

**URL:** <https://community.plotly.com/t/add-axis-labes-in-react-plotly/10551>\
**Category:** plotly.js\
**Created:** [May 29, 2018, 2:41am UTC](https://community.plotly.com/t/add-axis-labes-in-react-plotly/10551 "2018-05-29T02:41:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![racali](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@racali](https://community.plotly.com/u/racali)\
**Post date:** [May 29, 2018, 2:41am UTC](https://community.plotly.com/t/add-axis-labes-in-react-plotly/10551/1 "2018-05-29T02:41:39Z")

</div>

Hello everyone,

Just today I started using this library to create a 3D plot.  
Everything works well except that I am not able to add labels to my x, y, and z-axis.

I am doing everything on React by importing react-plotly.js as explained [here](https://plot.ly/javascript/react/).  
I am trying to use this [example](https://plot.ly/javascript/figure-labels/) to add the labels and I came up with something like this:  
\<Plot  
data={[  
{  
type: ‘surface’,  
x: graphData.x,  
y: graphData.y,  
z: graphData.z  
}  
]}  
layout={  
{  
width: 800,  
height: 600,  
title: graphData.masterGraph.title,  
xaxis: {  
name: ‘x Axis’,  
titlefont: {  
family: ‘Courier New, monospace’,  
size: 18,  
color: ‘#7f7f7f’  
}  
},  
yaxis: {  
name: ‘y Axis’,  
titlefont: {  
family: ‘Courier New, monospace’,  
size: 18,  
color: ‘#7f7f7f’  
}  
}  
}  
}  
/\>

Can anyone help me figuring out this problem or have other suggestions?

---

<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:** [May 29, 2018, 2:31pm UTC](https://community.plotly.com/t/add-axis-labes-in-react-plotly/10551/2 "2018-05-29T14:31:51Z")

</div>

You need to wrap your `xaxis` and `yaxis` attribute `{}` in `layout.scene`.

See [https://plot.ly/javascript/3d-axes/](https://plot.ly/javascript/3d-axes/)

---

<div class="post-metadata">

**Author:** ![racali](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@racali](https://community.plotly.com/u/racali)\
**Post date:** [May 31, 2018, 6:01pm UTC](https://community.plotly.com/t/add-axis-labes-in-react-plotly/10551/3 "2018-05-31T18:01:01Z")

</div>

Thank you very much, that did it!  
Also, would you know how to display a description when the cursor is hover one of the labels?
