@@ -26,7 +26,7 @@ def simple_plot():
2626
2727 # 生成画布,并设定标题
2828 plt .figure (figsize = (8 , 6 ), dpi = 80 )
29- plt .title ("可视化标题 " , fontproperties = myfont )
29+ plt .title ("简单曲线图 " , fontproperties = myfont )
3030 plt .grid (True )
3131
3232 # 设置X轴
@@ -40,8 +40,8 @@ def simple_plot():
4040 plt .yticks (np .linspace (- 1 , 1 , 9 , endpoint = True ))
4141
4242 # 画两条曲线
43- plt .plot (x , y_cos , "b--" , linewidth = 2.0 , label = "cos事例 " )
44- plt .plot (x , y_sin , "g-" , linewidth = 2.0 , label = "sin事例 " )
43+ plt .plot (x , y_cos , "b--" , linewidth = 2.0 , label = "cos示例 " )
44+ plt .plot (x , y_sin , "g-" , linewidth = 2.0 , label = "sin示例 " )
4545
4646 # 设置图例位置,loc可以为[upper, lower, left, right, center]
4747 plt .legend (loc = "upper left" , prop = myfont , shadow = True )
@@ -62,7 +62,7 @@ def simple_advanced_plot():
6262
6363 # 生成画布, 并设定标题
6464 plt .figure (figsize = (8 , 6 ), dpi = 80 )
65- plt .title ("可视化标题 " , fontproperties = myfont )
65+ plt .title ("复杂曲线图 " , fontproperties = myfont )
6666 plt .grid (True )
6767
6868 # 画图的另外一种方式
@@ -129,7 +129,7 @@ def bar_plot():
129129 means_women = (25 , 32 , 34 , 20 , 25 )
130130
131131 # 设置标题
132- plt .title ("可视化标题 " , fontproperties = myfont )
132+ plt .title ("柱状图 " , fontproperties = myfont )
133133
134134 # 设置相关参数
135135 index = np .arange (len (means_men ))
@@ -167,7 +167,7 @@ def barh_plot():
167167 means_women = (25 , 32 , 34 , 20 , 25 )
168168
169169 # 设置标题
170- plt .title ("plot title" )
170+ plt .title ("横向柱状图" , fontproperties = myfont )
171171
172172 # 设置相关参数
173173 index = np .arange (len (means_men ))
@@ -205,7 +205,7 @@ def bar_advanced_plot():
205205 means_women = np .array ((25 , 32 , 34 , 20 , 25 , 20 , 35 , 30 , 35 , 27 ))
206206
207207 # 设置标题
208- plt .title ("plot title" )
208+ plt .title ("高级柱状图" , fontproperties = myfont )
209209
210210 # 设置相关参数
211211 index = np .arange (len (means_men ))
@@ -247,7 +247,7 @@ def table_plot():
247247 ])
248248
249249 # 设置标题
250- plt .title ("可视化标题 " , fontproperties = myfont )
250+ plt .title ("层次柱状图 " , fontproperties = myfont )
251251
252252 # 设置相关参数
253253 index = np .arange (len (data [0 ]))
@@ -279,7 +279,7 @@ def histograms_plot():
279279 x = mu + sigma * np .random .randn (10000 )
280280
281281 # 设置标题
282- plt .title ("可视化标题 " , fontproperties = myfont )
282+ plt .title ("直方图 " , fontproperties = myfont )
283283
284284 # 画直方图, 并返回相关结果
285285 n , bins , patches = plt .hist (x , bins = 50 , normed = 1 , cumulative = False , color = "green" , alpha = 0.6 , label = "直方图" )
@@ -307,7 +307,7 @@ def pie_plot():
307307 colors = ["yellowgreen" , "gold" , "lightskyblue" , "lightcoral" ]
308308
309309 # 设置标题
310- plt .title ("可视化标题 " , fontproperties = myfont )
310+ plt .title ("饼图 " , fontproperties = myfont )
311311
312312 # 设置突出参数
313313 explode = [0 , 0.05 , 0 , 0 ]
@@ -334,7 +334,7 @@ def scatter_plot():
334334 y_index = np .random .random (point_count )
335335
336336 # 设置标题
337- plt .title ("可视化标题 " , fontproperties = myfont )
337+ plt .title ("散点图 " , fontproperties = myfont )
338338
339339 # 设置相关参数
340340 color_list = np .random .random (point_count )
@@ -358,7 +358,7 @@ def fill_plot():
358358 y = np .sin (x )
359359
360360 # 设置标题
361- plt .title ("可视化标题 " , fontproperties = myfont )
361+ plt .title ("填充图 " , fontproperties = myfont )
362362
363363 # 画图
364364 plt .plot (x , y , color = "blue" , alpha = 1.00 )
@@ -388,7 +388,7 @@ def radar_plot():
388388
389389 # 画图方式
390390 plt .subplot (111 , polar = True )
391- plt .title ("可视化标题 " , fontproperties = myfont )
391+ plt .title ("雷达图 " , fontproperties = myfont )
392392
393393 # 设置"theta grid"/"radar grid"
394394 plt .thetagrids (theta * (180 / np .pi ), labels = labels , fontproperties = myfont )
@@ -418,8 +418,10 @@ def three_dimension_scatter():
418418
419419 # 生成画布(两种形式)
420420 fig = plt .figure ()
421- # ax = fig.gca(projection="3d", title="plot title")
422- ax = fig .add_subplot (111 , projection = "3d" , title = "plot title" )
421+ fig .suptitle ("三维散点图" , fontproperties = myfont )
422+
423+ # ax = fig.gca(projection="3d")
424+ ax = fig .add_subplot (111 , projection = "3d" )
423425
424426 # 画三维散点图
425427 ax .scatter (x , y , z , s = scale , c = color , marker = "." )
0 commit comments