diff --git a/README.md b/README.md index dd3bf57..d3c1b1e 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ Matplotlib可以说是python数据可视化最重要且常见的工具之一, ## 使用说明 -- 使用前请将matplotlib升级到最新版本V3.3.3(2020年12月),否则可能会出现报错! +- 使用前请将matplotlib升级至V3.4.2以上(2022年1月),否则可能会出现报错! - 本教程独立网站已上线:[https://datawhalechina.github.io/fantastic-matplotlib/](https://datawhalechina.github.io/fantastic-matplotlib/) -- 使用时若发现任何问题,或是你对项目内容有好的建议,欢迎留言交流 +- 使用时若发现任何问题,或是你对项目内容有好的建议,欢迎留言交流,联系邮箱skywateryang@126.com ## 目录 @@ -41,31 +41,23 @@ Matplotlib可以说是python数据可视化最重要且常见的工具之一, > 和matplotlib的初次邂逅,赶紧拿出画布,画笔,一段奇幻的旅途即将开启 -本回作为引入,介绍了matplotlib可视化绘图包的特点,以及如何用最简单的几行代码画出一幅可视化图表。 - * 第二回:艺术画笔见乾坤 > 挥舞起手中的艺术画笔,发挥想象力,在画布上自由地绘制图形 -本回作为整个matplotlib宇宙中最重要的一个环节,重点介绍了matplotlib绘图的核心API,以及使用matplotlib绘制基本元素的方法 - * 第三回:布局格式定方圆 > 没有规矩不成方圆,你应当开始学会如何合理地在画布上布局了 -本回介绍了常用的两种绘图布局方法,让使用者可以自由地在画布中进行布局 - * 第四回:文字图例尽眉目 > 为了让你的画流传更久远,快来学习下如何在画布上题字吧 -本回介绍了如何在图像上,坐标轴上绘制文本,以及如何在图像上绘制图例。 - * 第五回:样式色彩秀芳华 > 下一步你需要学习下怎么样绘制出更加花样繁复,色彩绚丽的画了 -本回介绍了4种修改matplotlib绘图样式的方法,以及6种修改matplotlib色彩设置的方法 + ## 致谢 @@ -76,7 +68,7 @@ Matplotlib可以说是python数据可视化最重要且常见的工具之一, | 成员 | 个人简介 | 个人主页 | | ------ | ------------------------------------------- | -------------------------------------------------- | -| 杨剑砺 | Datawhale成员,**项目负责人**,数据分析师 | 公众号:口羊的数据分析实验室 | +| 杨剑砺 | Datawhale成员,**项目负责人**,数据分析师 | 公众号:口羊的数据分析实验室 | | 杨煜 | Datawhale成员,数据分析师 | 公众号:BI数据可视化 | | 耿远昊 | Datawhale成员,华东师范大学在读 | Github:https://github.com/GYHHAHA | | 李运佳 | Datawhale成员,上海交通大学在读 | 知乎:https://www.zhihu.com/people/li-yun-jia-68-9 | @@ -98,6 +90,12 @@ Matplotlib可以说是python数据可视化最重要且常见的工具之一, 第五章:杨剑砺 +> 《Fantastic-Matplotlib》V1.1 :第一次全面更新 + +全部章节的更新完善:杨剑砺 + + + ## 关注我们
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.
import numpy as np
+import pandas as pd
+import re
+import matplotlib
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+from matplotlib.patches import Circle, Wedge
+from matplotlib.collections import PatchCollection
+
primitive
是基本要素,它包含一些我们要在绘图区作图用到的标准图形对象,如曲线Line2D,文字text,矩形Rectangle,图像image等。
container
是容器,即用来装基本要素的地方,包括图形figure、坐标系Axes和坐标轴Axis。他们之间的关系如下图所示:
matplotlib的标准使用流程为:
-创建一个Figure
实例
使用Figure
实例创建一个或者多个Axes
或Subplot
实例
使用Axes
实例的辅助方法来创建primitive
值得一提的是,Axes是一种容器,它可能是matplotlib API中最重要的类,并且我们大多数时间都花在和它打交道上。更具体的信息会在第三节容器小节说明。
-一个流程示例及说明如下:
-import matplotlib.pyplot as plt
-import numpy as np
-
-# step 1
-# 我们用 matplotlib.pyplot.figure() 创建了一个Figure实例
-fig = plt.figure()
-
-# step 2
-# 然后用Figure实例创建了一个两行一列(即可以有两个subplot)的绘图区,并同时在第一个位置创建了一个subplot
-ax = fig.add_subplot(2, 1, 1) # two rows, one column, first plot
-
-# step 3
-# 然后用Axes实例的方法画了一条曲线
-t = np.arange(0.0, 1.0, 0.01)
-s = np.sin(2*np.pi*t)
-line, = ax.plot(t, s, color='blue', lw=2)
-
可视化中常见的artist类可以参考下图这张表格,解释下每一列的含义。
+第一列表示matplotlib中子图上的辅助方法,可以理解为可视化中不同种类的图表类型,如柱状图,折线图,直方图等,这些图表都可以用这些辅助方法直接画出来,属于更高层级的抽象。
第二列表示不同图表背后的artist类,比如折线图方法plot
在底层用到的就是Line2D
这一artist类。
第三列是第二列的列表容器,例如所有在子图中创建的Line2D
对象都会被自动收集到ax.lines
返回的列表中。
下一节的具体案例更清楚地阐释了这三者的关系,其实在很多时候,我们只用记住第一列的辅助方法进行绘图即可,而无需关注具体底层使用了哪些类,但是了解底层类有助于我们绘制一些复杂的图表,因此也很有必要了解。
+Axes helper method |
+Artist |
+Container |
+
---|---|---|
|
+
|
+ax.patches |
+
|
+
|
+ax.lines and ax.patches |
+
|
+
|
+ax.patches |
+
|
+
|
+ax.patches |
+
|
+
|
+ax.images |
+
|
+
|
+ax.lines |
+
|
+
|
+ax.collections |
+
各容器中可能会包含多种基本要素-primitives
, 所以先介绍下primitives,再介绍容器。
本章重点介绍下 primitives
的几种类型:曲线-Line2D,矩形-Rectangle,图像-image (其中文本-Text较为复杂,会在之后单独详细说明。)
本章重点介绍下 primitives
的几种类型:曲线-Line2D,矩形-Rectangle,多边形-Polygon,图像-image
在matplotlib中曲线的绘制,主要是通过类 matplotlib.lines.Line2D
来完成的。
-它的基类: matplotlib.artist.Artist
在matplotlib中曲线的绘制,主要是通过类 matplotlib.lines.Line2D
来完成的。
matplotlib中线-line
的含义:它表示的可以是连接所有顶点的实线样式,也可以是每个顶点的标记。此外,这条线也会受到绘画风格的影响,比如,我们可以创建虚线种类的线。
它的构造函数:
@@ -393,7 +413,7 @@marker:点的标记,详细可参考markers API
- markersize:标记的size
其他详细参数可参考Line2D官方文档
+其他详细参数可参考Line2D官方文档
a. 如何设置Line2D的属性¶
有三种方法可以用设置线的属性。
@@ -405,7 +425,6 @@# 1) 直接在plot()函数中设置 -import matplotlib.pyplot as plt x = range(0,5) y = [2,5,7,8,10] plt.plot(x,y, linewidth=10); # 设置线的粗细参数为10 @@ -413,7 +432,7 @@-+
@@ -421,13 +440,13 @@# 2) 通过获得线对象,对线对象进行设置 x = range(0,5) y = [2,5,7,8,10] -line, = plt.plot(x, y, '-') -line.set_antialiased(False) # 关闭抗锯齿功能 +line, = plt.plot(x, y, '-') # 这里等号坐标的line,是一个列表解包的操作,目的是获取plt.plot返回列表中的Line2D对象 +line.set_antialiased(False); # 关闭抗锯齿功能-+
@@ -441,7 +460,7 @@-+
![]()
绘制直线line
errorbar绘制误差折线图
绘制直线line常用的方法有两种:
+介绍两种绘制直线line常用的方法:
pyplot方法绘制
plot方法绘制
Line2D对象绘制
# 1. pyplot方法绘制
-import matplotlib.pyplot as plt
+# 1. plot方法绘制
x = range(0,5)
-y = [2,5,7,8,10]
-plt.plot(x,y);
+y1 = [2,5,7,8,10]
+y2= [3,6,8,9,11]
+
+fig,ax= plt.subplots()
+ax.plot(x,y1)
+ax.plot(x,y2)
+print(ax.lines); # 通过直接使用辅助方法画线,打印ax.lines后可以看到在matplotlib在底层创建了两个Line2D对象
+
+
+
[<matplotlib.lines.Line2D object at 0x000001EBFE710A90>, <matplotlib.lines.Line2D object at 0x000001EBFE710E20>]
+
# 2. Line2D对象绘制
+
+x = range(0,5)
+y1 = [2,5,7,8,10]
+y2= [3,6,8,9,11]
+fig,ax= plt.subplots()
+lines = [Line2D(x, y1), Line2D(x, y2,color='orange')] # 显式创建Line2D对象
+for line in lines:
+ ax.add_line(line) # 使用add_line方法将创建的Line2D添加到子图中
+ax.set_xlim(0,4)
+ax.set_ylim(2, 11);
# 2. Line2D对象绘制
-import matplotlib.pyplot as plt
-from matplotlib.lines import Line2D
-
-fig = plt.figure()
-ax = fig.add_subplot(111)
-line = Line2D(x, y)
-ax.add_line(line)
-ax.set_xlim(min(x), max(x))
-ax.set_ylim(min(y), max(y))
-
-plt.show()
-
+
2) errorbar绘制误差折线图
pyplot里有个专门绘制误差线的功能,通过errorbar
类实现,它的构造函数:
@@ -509,9 +536,7 @@ pyplot里有个专门绘制误差线的功能,通过
-import numpy as np
-import matplotlib.pyplot as plt
-fig = plt.figure()
+fig = plt.figure()
x = np.arange(10)
y = 2.5 * np.sin(x / 20 * np.pi)
yerr = np.linspace(0.05, 0.2, 10)
@@ -520,21 +545,24 @@ pyplot里有个专门绘制误差线的功能,通过
-
+
+
+
2. patches¶
-matplotlib.patches.Patch类是二维图形类。它的基类是matplotlib.artist.Artist,它的构造函数:
-详细清单见 matplotlib.patches API
+matplotlib.patches.Patch类是二维图形类,并且它是众多二维图形的父类,它的所有子类见matplotlib.patches API ,
+Patch类的构造函数:
Patch(edgecolor=None, facecolor=None, color=None,
linewidth=None, linestyle=None, antialiased=None,
hatch=None, fill=True, capstyle=None, joinstyle=None,
**kwargs)
+本小节重点讲述三种最常见的子类,矩形,多边形和楔型。
a. Rectangle-矩形¶
Rectangle
矩形类在官网中的定义是: 通过锚点xy及其宽度和高度生成。
@@ -542,7 +570,7 @@ Rectangle本身的主要比较简单,即xy控制锚点,width和height分别
class matplotlib.patches.Rectangle(xy, width, height, angle=0.0, **kwargs)
-在实际中最常见的矩形图是**hist直方图
和bar条形图
**。
+在实际中最常见的矩形图是hist直方图
和bar条形图
。
1) hist-直方图
matplotlib.pyplot.hist(x,bins=None,range=None, density=None, bottom=None, histtype='bar', align='mid', log=False, color=None, label=None, stacked=False, normed=None)
@@ -561,28 +589,24 @@ Rectangle本身的主要比较简单,即xy控制锚点,width和height分别
hist绘制直方图
-import matplotlib.pyplot as plt
-import numpy as np
-x=np.random.randint(0,100,100) #生成[0-100)之间的100个数据,即 数据集
+x=np.random.randint(0,100,100) #生成[0-100)之间的100个数据,即 数据集
bins=np.arange(0,101,10) #设置连续的边界值,即直方图的分布区间[0,10),[10,20)...
plt.hist(x,bins,color='fuchsia',alpha=0.5)#alpha设置透明度,0为完全透明
plt.xlabel('scores')
plt.ylabel('count')
-plt.xlim(0,100)#设置x轴分布范围
-plt.show()
+plt.xlim(0,100); #设置x轴分布范围 plt.show()
-
+
+
Rectangle
矩形类绘制直方图
-import pandas as pd
-import re
-df = pd.DataFrame(columns = ['data'])
+df = pd.DataFrame(columns = ['data'])
df.loc[:,'data'] = x
df['fenzu'] = pd.cut(df['data'], bins=bins, right = False,include_lowest=True)
@@ -594,7 +618,6 @@ Rectangle本身的主要比较简单,即xy控制锚点,width和height分别
df_cnt.reset_index(inplace = True,drop = True)
#用Rectangle把hist绘制出来
-import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111)
@@ -604,15 +627,16 @@ Rectangle本身的主要比较简单,即xy控制锚点,width和height分别
ax1.add_patch(rect)
ax1.set_xlim(0, 100)
-ax1.set_ylim(0, 16)
-plt.show()
+ax1.set_ylim(0, 16);
-
+
+
+
2) bar-柱状图
matplotlib.pyplot.bar(left, height, alpha=1, width=0.8, color=, edgecolor=, label=, lw=3)
@@ -635,20 +659,19 @@ Rectangle本身的主要比较简单,即xy控制锚点,width和height分别
# bar绘制柱状图
-import matplotlib.pyplot as plt
y = range(1,17)
plt.bar(np.arange(16), y, alpha=0.5, width=0.5, color='yellow', edgecolor='red', label='The First Bar', lw=3);
-
+
+
# Rectangle矩形类绘制柱状图
-#import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111)
@@ -656,8 +679,7 @@ Rectangle本身的主要比较简单,即xy控制锚点,width和height分别
rect = plt.Rectangle((i+0.25,0),0.5,i)
ax1.add_patch(rect)
ax1.set_xlim(0, 16)
-ax1.set_ylim(0, 16)
-plt.show()
+ax1.set_ylim(0, 16);
@@ -665,10 +687,12 @@ Rectangle本身的主要比较简单,即xy控制锚点,width和height分别
+
+
b. Polygon-多边形¶
-matplotlib.patches.Polygon类是多边形类。其基类是matplotlib.patches.Patch,它的构造函数:
+matplotlib.patches.Polygon类是多边形类。它的构造函数:
class matplotlib.patches.Polygon(xy, closed=True, **kwargs)
@@ -682,7 +706,6 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
# 用fill来绘制图形
-import matplotlib.pyplot as plt
x = np.linspace(0, 5 * np.pi, 1000)
y1 = np.sin(x)
y2 = np.sin(2 * x)
@@ -694,6 +717,8 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
+
c. Wedge-契形¶
@@ -719,14 +744,12 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
pie绘制饼状图
-import matplotlib.pyplot as plt
-labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
+labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
explode = (0, 0.1, 0, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True, startangle=90)
-ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
-plt.show()
+ax1.axis('equal'); # Equal aspect ratio ensures that pie is drawn as a circle.
@@ -734,29 +757,26 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
+
wedge绘制饼图
-import matplotlib.pyplot as plt
-from matplotlib.patches import Circle, Wedge
-from matplotlib.collections import PatchCollection
-
-fig = plt.figure()
+fig = plt.figure(figsize=(5,5))
ax1 = fig.add_subplot(111)
theta1 = 0
sizes = [15, 30, 45, 10]
patches = []
patches += [
- Wedge((0.3, 0.3), .2, 0, 54), # Full circle
- Wedge((0.3, 0.3), .2, 54, 162), # Full ring
- Wedge((0.3, 0.3), .2, 162, 324), # Full sector
- Wedge((0.3, 0.3), .2, 324, 360), # Ring sector
+ Wedge((0.5, 0.5), .4, 0, 54),
+ Wedge((0.5, 0.5), .4, 54, 162),
+ Wedge((0.5, 0.5), .4, 162, 324),
+ Wedge((0.5, 0.5), .4, 324, 360),
]
colors = 100 * np.random.rand(len(patches))
-p = PatchCollection(patches, alpha=0.4)
+p = PatchCollection(patches, alpha=0.8)
p.set_array(colors)
-ax1.add_collection(p)
-plt.show()
+ax1.add_collection(p);
@@ -764,6 +784,8 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
+
@@ -786,8 +808,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
x = [0,2,4,6,8,10]
y = [10]*len(x)
s = [20*2**n for n in range(len(x))]
-plt.scatter(x,y,s=s)
-plt.show()
+plt.scatter(x,y,s=s) ;
@@ -795,6 +816,8 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
+
4. images¶
@@ -809,9 +832,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
使用imshow画图时首先需要传入一个数组,数组对应的是空间内的像素位置和像素点的值,interpolation参数可以设置不同的差值方法,具体效果如下。
-import matplotlib.pyplot as plt
-import numpy as np
-methods = [None, 'none', 'nearest', 'bilinear', 'bicubic', 'spline16',
+methods = [None, 'none', 'nearest', 'bilinear', 'bicubic', 'spline16',
'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos']
@@ -825,8 +846,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
ax.imshow(grid, interpolation=interp_method, cmap='viridis')
ax.set_title(str(interp_method))
-plt.tight_layout()
-plt.show()
+plt.tight_layout();
@@ -834,6 +854,8 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
+
@@ -842,7 +864,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
比如Axes Artist
,它是一种容器,它包含了很多primitives
,比如Line2D
,Text
;同时,它也有自身的属性,比如xscal
,用来控制X轴是linear
还是log
的。
1. Figure容器¶
-matplotlib.figure.Figure
是Artist
最顶层的container
-对象容器,它包含了图表中的所有元素。一张图表的背景就是在Figure.patch
的一个矩形Rectangle
。
+
matplotlib.figure.Figure
是Artist
最顶层的container
对象容器,它包含了图表中的所有元素。一张图表的背景就是在Figure.patch
的一个矩形Rectangle
。
当我们向图表添加Figure.add_subplot()
或者Figure.add_axes()
元素时,这些都会被添加到Figure.axes
列表中。
@@ -862,7 +884,6 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
-
由于Figure
维持了current axes
,因此你不应该手动的从Figure.axes
列表中添加删除元素,而是要通过Figure.add_subplot()
、Figure.add_axes()
来添加元素,通过Figure.delaxes()
来删除元素。但是你可以迭代或者访问Figure.axes
中的Axes
,然后修改这个Axes
的属性。
比如下面的遍历axes里的内容,并且添加网格线:
@@ -872,7 +893,6 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
for ax in fig.axes:
ax.grid(True)
-
@@ -880,6 +900,8 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
+
Figure
也有它自己的text、line、patch、image
。你可以直接通过add primitive
语句直接添加。但是注意Figure
默认的坐标系是以像素为单位,你可能需要转换成figure坐标系:(0,0)表示左下点,(1,1)表示右上点。
Figure容器的常见属性:
Figure.patch
属性:Figure的背景矩形
@@ -895,11 +917,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
和Figure
容器类似,Axes
包含了一个patch属性,对于笛卡尔坐标系而言,它是一个Rectangle
;对于极坐标而言,它是一个Circle
。这个patch属性决定了绘图区域的形状、背景和边框。
-import numpy as np
-import matplotlib.pyplot as plt
-import matplotlib
-
-fig = plt.figure()
+fig = plt.figure()
ax = fig.add_subplot(111)
rect = ax.patch # axes的patch是一个Rectangle实例
rect.set_facecolor('green')
@@ -910,6 +928,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
Axes
有许多方法用于绘图,如.plot()、.text()、.hist()、.imshow()
等方法用于创建大多数常见的primitive
(如Line2D,Rectangle,Text,Image
等等)。在primitives
中已经涉及,不再赘述。
Subplot就是一个特殊的Axes,其实例是位于网格中某个区域的Subplot实例。其实你也可以在任意区域创建Axes,通过Figure.add_axes([left,bottom,width,height])来创建一个任意区域的Axes,其中left,bottom,width,height都是[0—1]之间的浮点数,他们代表了相对于Figure的坐标。
你不应该直接通过Axes.lines
和Axes.patches
列表来添加图表。因为当创建或添加一个对象到图表中时,Axes
会做许多自动化的工作:
@@ -921,15 +940,15 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
ax.yaxis
:YAxis对象的实例,用于处理y轴tick以及label的绘制
会在下面章节详细说明。
Axes容器的常见属性有:
-artists
: Artist实例列表
-patch
: Axes所在的矩形实例
-collections
: Collection实例
-images
: Axes图像
-legends
: Legend 实例
-lines
: Line2D 实例
-patches
: Patch 实例
-texts
: Text 实例
-xaxis
: matplotlib.axis.XAxis 实例
+artists
: Artist实例列表
+patch
: Axes所在的矩形实例
+collections
: Collection实例
+images
: Axes图像
+legends
: Legend 实例
+lines
: Line2D 实例
+patches
: Patch 实例
+texts
: Text 实例
+xaxis
: matplotlib.axis.XAxis 实例
yaxis
: matplotlib.axis.YAxis 实例
@@ -967,6 +986,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
下面的例子展示了如何调整一些轴和刻度的属性(忽略美观度,仅作调整参考):
@@ -990,8 +1010,6 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
line.set_color('green') # 颜色
line.set_markersize(25) # marker大小
line.set_markeredgewidth(2)# marker粗细
-
-plt.show()
@@ -999,6 +1017,7 @@ closed为True则指定多边形将起点和终点重合从而显式关闭多边
+
4. Tick容器¶
@@ -1015,11 +1034,7 @@ x轴分为上下两个,因此tick1对应下侧的轴;tick2对应上侧的轴
下面的例子展示了,如何将Y轴右边轴设为主轴,并将标签设置为美元符号且为绿色:
-import numpy as np
-import matplotlib.pyplot as plt
-import matplotlib
-
-fig, ax = plt.subplots()
+fig, ax = plt.subplots()
ax.plot(100*np.random.rand(20))
# 设置ticker的显示格式
@@ -1036,14 +1051,27 @@ x轴分为上下两个,因此tick1对应下侧的轴;tick2对应上侧的轴
+
+
@@ -1064,9 +1092,9 @@ x轴分为上下两个,因此tick1对应下侧的轴;tick2对应上侧的轴
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.
diff --git a/docs/第五回:样式色彩秀芳华/index.html b/docs/第五回:样式色彩秀芳华/index.html
index 7679d63..a0dfd10 100644
--- a/docs/第五回:样式色彩秀芳华/index.html
+++ b/docs/第五回:样式色彩秀芳华/index.html
@@ -289,7 +289,7 @@
-
+
@@ -349,7 +349,7 @@ ytick.labelsize : 16
另外matplotlib也还提供了了一种更便捷的修改样式方式,可以一次性修改多个样式。
@@ -389,7 +389,7 @@ ytick.labelsize : 16
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.
@@ -493,7 +493,7 @@ ylabel方式类似,这里不重复写出。
@@ -523,7 +523,7 @@ annotate的参数非常复杂,这里仅仅展示一个简单的例子,更多
@@ -557,7 +557,7 @@ annotate的参数非常复杂,这里仅仅展示一个简单的例子,更多
@@ -909,9 +909,9 @@ ax.legend(loc='upper center') 等同于ax.legend(loc=9)
- By Datawhale
+ By Datawhale数据可视化开源小组
- © Copyright © Copyright 2020.
+ © Copyright © Copyright 2021.