I found this very cool and usefull way ( I am very new to Python) to do tables.
import plotly.graph_objects as go
fig = go.Figure(data=[go.Table(
header=dict(values=['Column1', 'Column2'],
line_color='rgb(255,255,255)',
fill_color='rgb(230,100,100)',
align='left'),
cells=dict(values=[[100, 90, 80, 90], # 1st column
[95, 85, 75, 95]], # 2nd column
line_color='rgb(255,255,255)',
fill_color= 'rgb(255,255,255)',
align='left'))
])
fig.update_layout(width=500, height=300)
fig.show()
Unfortunately I could not find a way to save this as a png, is there a way?
Simply use the write_image()
function. See the documentation: https://plot.ly/python/static-image-export/
So that would be: write_image("image.png")
You can save it as loads of other formats too including bmp, jpeg, pdf
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.