Chartify是Spotify开源的Python可视化库,简化了创建图表的过程。
import chartify
# 加载示例数据
data = chartify.examples.example_data()
data.head()
# 创建图表
ch = chartify.Chart(x_axis_type='datetime')
ch.set_title("Quantity Fruit vs Date")
ch.set_subtitle("Quantity of fruits grown all around the world")
ch.axes.set_xaxis_label("Date")
ch.axes.set_yaxis_label("Quantity")
ch.set_source_label("Source:Chartify Examples")
ch.plot.scatter(
data_frame=data,
x_column='date',
y_column='quantity',
color_column='fruit'
)
ch.show()