# Fixing Y axis 2

**URL:** <https://community.plotly.com/t/fixing-y-axis-2/13289>\
**Category:** plotly.js\
**Created:** [September 4, 2018, 4:55pm UTC](https://community.plotly.com/t/fixing-y-axis-2/13289 "2018-09-04T16:55:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirthomasii](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@sirthomasii](https://community.plotly.com/u/sirthomasii)\
**Post date:** [September 4, 2018, 4:55pm UTC](https://community.plotly.com/t/fixing-y-axis-2/13289/1 "2018-09-04T16:55:16Z")

</div>

Hey there. I am having a funny time trying to fix the second y axis on the following page.

[http://ics-webread01.esss.lu.se/](http://ics-webread01.esss.lu.se/)

What I want is the range to autofit every few seconds, and then become fixed, but is not working for y axis 2.

intial parameters:  
yaxis2: {  
title: ‘Proton Rate’,  
titlefont: {color: trace2Color},  
tickfont: {color: trace2Color},  
overlaying: ‘y’,  
side: ‘right’,  
fixedrange: true

```
            },

```

Update code that runs once every 42 frames :

if ((PVFrame[PVNames][traceNum] == 2) || (updatePlots==true)) {  
var update = {  
‘xaxis.autorange’: true,  
‘yaxis.autorange’: true,  
‘yaxis2.autorange’: true,  
};  
Plotly.relayout(plotName, update)  
updatePlots==false;  
}  
else if ((PVFrame[PVNames][traceNum] == 3)) {  
var update = {  
‘xaxis.autorange’: false,  
‘xaxis.fixedrange’: true,  
‘yaxis.autorange’: false,  
‘yaxis.fixedrange’: true,  
‘yaxis2.autorange’: false,  
‘yaxis2.fixedrange’: true,  
};  
Plotly.relayout(plotName, update)

Thanks for any and all insights. 🙂

---

<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:** [September 7, 2018, 4:54pm UTC](https://community.plotly.com/t/fixing-y-axis-2/13289/2 "2018-09-07T16:54:29Z")

</div>

> [@sirthomasii](#):
>
> and then become fixed,

Can you clarify what you mean by _fixed_

Fixed as in:

- does not auto-range as new data comes in, or
- users can no longer zoom about this particular axis?
