MediaFileManager: Missing file when try to plot two line chart on the same figure. sometimes it is working fine but most of the time doesn’t show anything
code
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
class Economics():
def demand_supply_cruve(self , data=None):
"""Graph demand and supply curve
inputs
--------------------------------
Data is a {price:[] , 'Demand':[1,2,3....] , 'Supply':[1,2,3,....] } per unit
"""
data = data if data != None else {'price':list(range(0,201,10)) ,'Demand':list(range(0,401,20))[::-1] , 'Supply':list(range(0,401,20))}
data = pd.DataFrame(data)
fig, ax = plt.subplots()
sns.lineplot( x=data["Demand"], y=data["price"])
sns.lineplot( data=data, x="Supply", y="price")
return fig
import streamlit as st
st.title("Eco")
eco = Economics()
st.pyplot(eco.demand_supply_cruve())