I'm looking for a way to save outputs from Stargazer to file akin to savefig for pyplot outputs. I tried savefig but Stargazer does not seem to have this function.
I turned a regression model into Stargazer form. I'm able to get the visual all and well but am unable to save it to file. The method I found (Python Stargazer LaTeX output unusable) outputs a file but I'm unable to open it. I have a Stargazer outputfile names 'stargazer_tab'
This is my code:
file_name = "model1.png" #Include directory path if needed
tex_file = open( file_name, "w" ) #This will overwrite an existing file
tex_file.write( stargazer_tab.render_latex() )
tex_file.close()
I end up with a file tht can't be opened.