I am using the following piece of code
import pandas as pd
from matplotlib import pyplot as plt
%matplotlib inline
x = [1, 2, 3, 4, 5, 6]
y = [2, 6, 5, 12, 10, 16]
data_viz = plt.plot(x, y)
.... other code
plt.show(data_viz)
When I run this, I dont get any results. Its simply a blank - no error, nothing. I wish to display the plot which I saved as data_viz. What can I do?
I am using Jupyter Notebook or Jupyter lab or Google colab but both are getting the same issue.
I tested this code on Chatgpt and it doesnt find any error. I tried googling it but havent been able to find a relevant answer.