How to get python graph output into html webpage directly

前端 未结 4 1792
别跟我提以往
别跟我提以往 2021-02-14 11:20

I am using different libraries like pandas and numpy for generating a dataframe, which eventually generate a graph.

Now, I need to show this graph into a simple webpage

4条回答
  •  孤街浪徒
    2021-02-14 11:26

    You may like to save the graph into specific location and write script to read the image file lets say pic.png into HTML. For taking input, you may create a Tabular structure of data and after each input, save the data to a file, lets say file.csv and read it in Python and keep adding values from input.

    import matplotlib.pyplot as plt
    df.hist()
    plt.savefig('path/to/pic.png')
    

    Now create HTML code to read that image file and output it as you want. I hope this helps.

提交回复
热议问题