0

I have used the following code

fig, ax1 = plt.subplots(figsize=(9,9))
ax2 = ax1.twinx()
ax1.plot(x, y1, 'g')
ax2.plot(x, y2, 'b')
ax1.set_xlabel('Time')
ax1.set_ylabel('Call OI', color='g')
ax2.set_ylabel('Put OI', color='b')

plt.show()

x contains incremental time y1 and y2 contain OpenInterest data from call and put side.

Also I assume that the Y-axis would be a incremental scale, but in my case, it is ditto copied sequence data from the list. I am only getting a straight line as a result

Pls check my work and output: Checkout the imgur image link (contains 4 images)

The link contains : Google sheets chart which is what I need, and the work at Jupyter-notebook is where I am lagging

rbhlinux3
  • 9
  • 2
  • **[Don't Post Screenshots](https://meta.stackoverflow.com/questions/303812/)**. This question needs a [SSCCE](http://sscce.org/). Always provide a [mre], with **code, data, errors, current output, and expected output, as [formatted text](https://stackoverflow.com/help/formatting)**. It's likely the question will be down-voted and closed. You're discouraging assistance, as no one wants to retype data/code, and screenshots are often illegible. [edit] the question and **add text**. Plots are okay. See [How to provide a reproducible dataframe](https://stackoverflow.com/questions/52413246). – Trenton McKinney Nov 23 '21 at 01:45
  • In your left axis, there are labels such as "1,01,381" (not sure if comma or dot). What is the data type of your columns? – fdireito Nov 23 '21 at 09:18
  • I will format it accordingly @Trenton. Thanks – rbhlinux3 Nov 23 '21 at 11:46
  • @fdireito. Thanks a lot dude for that thinking line. I was coding 7 hours straight and this simply didnt even click at that time. Some else line of thought I had prolly that time. Thanks it helped. – rbhlinux3 Nov 23 '21 at 11:54

0 Answers0