Python graphics still use Matplotlib? out of! Found a hand-painted visual artifact!

Foreword

Text and images in this article from the network, only to learn, exchange, not for any commercial purposes, belongs to original author, if any questions, please contact us for treatment.

GitHub Address: https://github.com/chenjiandongx/cutecharts

PS: If necessary Python learning materials can be added to a small partner click the link below to obtain their own

http://note.youdao.com/noteshare?id=3054cce4add8a909e784ad934f956cef

Today, to introduce a cool visual style of hand-painted Python packages God: cutecharts.

And common chart Matplotlib, pyecharts so different, this package may be generated using a variety of charts that looks like a hand-drawn below, in some scenarios may be more effective.

The command line to install the library:

pip install cutecharts

 

Histogram

 1 from cutecharts.charts import Bar
 2 from cutecharts.components import Page
 3 from cutecharts.faker import Faker
 4  5  6 def bar_base() -> Bar:
 7     chart = Bar("Bar-基本示例")
 8     chart.set_options(labels=Faker.choose(), x_label="I'm xlabel", y_label="I'm ylabel")
 9     chart.add_series("series-A", Faker.values())
10     return chart
11 12 bar_base().render()

 

Here Insert Picture Description

line chart

 1 from cutecharts.charts import Line
 2 from cutecharts.components import Page
 3 from cutecharts.faker import Faker
 4  5  6 def line_base() -> Line:
 7     chart = Line("Line-基本示例")
 8     chart.set_options(labels=Faker.choose(), x_label="I'm xlabel", y_label="I'm ylabel")
 9     chart.add_series("series-A", Faker.values())
10     chart.add_series("series-B", Faker.values())
11     return chart
12 line_base().render()

 

Here Insert Picture Description

Pie

 1 from cutecharts.charts import Pie
 2 from cutecharts.components import Page
 3 from cutecharts.faker import Faker
 4  5  6 def pie_base() -> Pie:
 7     chart = Pie("Pie-基本示例")
 8     chart.set_options(labels=Faker.choose())
 9     chart.add_series(Faker.values())
10     return chart
11 pie_base().render()

 

Here Insert Picture Description

雷达图

 1 from cutecharts.charts import Radar
 2 from cutecharts.components import Page
 3 from cutecharts.faker import Faker
 4  5  6 def radar_base() -> Radar:
 7     chart = Radar("Radar-基本示例")
 8     chart.set_options(labels=Faker.choose())
 9     chart.add_series("series-A", Faker.values())
10     chart.add_series("series-B", Faker.values())
11     return chart
12 13 14 radar_base().render()

 

Here Insert Picture Description

散点图

 1 from cutecharts.charts import Scatter
 2 from cutecharts.components import Page
 3 from cutecharts.faker import Faker
 4  5  6 def scatter_base() -> Scatter:
 7     chart = Scatter("Scatter-基本示例")
 8     chart.set_options(x_label="I'm xlabel", y_label="I'm ylabel")
 9     chart.add_series(
10         "series-A", [(z[0], z[1]) for z in zip(Faker.values(), Faker.values())]
11     )
12     chart.add_series(
13         "series-B", [(z[0], z[1]) for z in zip(Faker.values(), Faker.values())]
14     )
15     return chart
16 17 18 scatter_base().render()

 

Here Insert Picture Description

I feel good rush to taste fresh!

Guess you like

Origin www.cnblogs.com/Qqun821460695/p/11984778.html