摘要: 环形图 环形图其实是另一种饼图,使用的还是上面的 pie() 这个方法,这里只需要设置一下参数 wedgeprops 即可。 例子一: import matplotlib.pyplot as plt # 中文和负号的正常显示 plt.rcParams['font.sans-serif']=['Sim 阅读全文
posted @ 2020-04-19 18:15 秋华 阅读(1159) 评论(0) 推荐(0) 编辑
摘要: 1 气泡图 气泡图和上面的散点图非常类似,只是点的大小不一样,而且是通过参数 s 来进行控制的,多的不说,还是看个示例: 例子一: import matplotlib.pyplot as plt import numpy as np # 处理中文乱码 plt.rcParams['font.sans- 阅读全文
posted @ 2020-04-19 15:32 秋华 阅读(1360) 评论(0) 推荐(0) 编辑
摘要: 1 折线图 折线图主要用于表现随着时间的推移而产生的某种趋势。 cat = ["bored", "happy", "bored", "bored", "happy", "bored"] dog = ["happy", "happy", "happy", "happy", "bored", "bore 阅读全文
posted @ 2020-04-19 15:27 秋华 阅读(664) 评论(0) 推荐(0) 编辑
摘要: https://matplotlib.org/api/rcsetup_api.html#module-matplotlib.rcsetup 一、什么是rcParams?我们在使用matplotliblib画图的时候经常会遇见中文或者是负号无法显示的情况,我们会添加下面两句话: from matplo 阅读全文
posted @ 2020-04-19 15:23 秋华 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 1.前言 图表要素如下图所示 # sphinx_gallery_thumbnail_number = 3 import matplotlib.pyplot as plt import numpy as np 2 画布(Figure) https://matplotlib.org/api/figure 阅读全文
posted @ 2020-04-19 15:21 秋华 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 一、与字符串的相互转换 1.字符串转变为etree 对象 import lxml.html tree = lxml.html.fromstring(content) # content 字符串对象 2.etree对象转变为字符串 from lxml import etree content = et 阅读全文
posted @ 2020-04-19 13:42 秋华 阅读(836) 评论(0) 推荐(0) 编辑