# Two y axis for two independent series in plotly

**URL:** https://community.plotly.com/t/two-y-axis-for-two-independent-series-in-plotly/7012
**Category:** 📊 Plotly Python
**Created:** [November 27, 2017, 7:28am UTC](https://community.plotly.com/t/two-y-axis-for-two-independent-series-in-plotly/7012 "2017-11-27T07:28:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hubert](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hubert](https://community.plotly.com/u/hubert)
#### Post date: [November 27, 2017, 7:28am UTC](https://community.plotly.com/t/two-y-axis-for-two-independent-series-in-plotly/7012/1 "2017-11-27T07:28:56Z")

</div>

I’d like to create simple plolty graphs in python for my two PCs. It’s simple graph of program runs vs time (hourly) on each PC. I’d like those graphs to have a common x axis, to easily compare data between PCs when mouse hovers over the chart.

How do I do this? Is there a tutorial I can follow? I couldn’t find anything on the tutorials site.

Also I’ve linked that to same question on StackOverflow:  
[https://stackoverflow.com/questions/47455937/two-y-axis-for-two-independent-series-in-plotly](https://stackoverflow.com/questions/47455937/two-y-axis-for-two-independent-series-in-plotly)

---

<div class="post-metadata">

### Author: ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)
#### Post date: [November 27, 2017, 12:03pm UTC](https://community.plotly.com/t/two-y-axis-for-two-independent-series-in-plotly/7012/2 "2017-11-27T12:03:55Z")

</div>

@hubert Here is an example of plot with left and right yaxis: [https://plot.ly/~empet/14349](https://plot.ly/~empet/14349)

---

<div class="post-metadata">

### Author: ![hubert](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hubert](https://community.plotly.com/u/hubert)
#### Post date: [November 27, 2017, 1:37pm UTC](https://community.plotly.com/t/two-y-axis-for-two-independent-series-in-plotly/7012/3 "2017-11-27T13:37:53Z")

</div>

@empet I think that vou’ve missed my point here. I do not want to have two sets of data on one plot (as I want to present data for different machines). I need one y axis over another.  
The difference between my attempt and two separate plots, is jost one: when I hoover over one point on plot (eg.x=500, y=300), it will show me data on both plots. Please look on graphics on StackOverflow link

---

<div class="post-metadata">

### Author: ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)
#### Post date: [November 27, 2017, 3:23pm UTC](https://community.plotly.com/t/two-y-axis-for-two-independent-series-in-plotly/7012/4 "2017-11-27T15:23:00Z")

</div>

@hubert I don’t understand precisely what you want.

1. Do you want two subplots in one column as the plots posted on stackoverflow with a shared xaxis?  
If this is the case you should define:

With such a definition you cannot display tooltips on both subplots simultaneously. When you hover over one subplot only information in that subplot is displayed.

2)What to do mean by “_one y axis over another_”? Both yaxes on the left side of the plot?

The only solution at the moment is to insert the two plots on the same window as in the example I posted. Obviously instead of bars and line in my plot you should insert your lines.

---

<div class="post-metadata">

### Author: ![hubert](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hubert](https://community.plotly.com/u/hubert)
#### Post date: [November 28, 2017, 9:06am UTC](https://community.plotly.com/t/two-y-axis-for-two-independent-series-in-plotly/7012/5 "2017-11-28T09:06:41Z")

</div>

Yep, what i needed was subplots with shared xaxes, thank you @empet for support and help 🙂
