打卡交作業(yè)啦#2022年01月11日

這次主要學(xué)習(xí)的是matplotlib的框架,原來一張圖表有這么多講究,真是學(xué)習(xí)了。


### 第一回

# fig,ax= plt.subplots()

# ax.plot([1,2,3,4],[1,4,2,3])

# plt.show()

# line = plt.plot([1,2,3,4],[1,4,2,3])

# x = np.linspace(0,2,100)

# fig,ax = plt.subplots()

# ax.plot(x,x,label = 'linear')

# ax.plot(x,x**2,label='quadratic')

# ax.plot(x,x**3,label='cubic')

# ax.set_xlabel('x label')

# ax.set_ylabel('y label')

# ax.set_title('Simple Plot')

# ax.legend()

# plt.show()

# x = np.linspace(0,2,100)

# plt.plot(x,x,label = 'linear')

# plt.plot(x,x**2,label = 'quadratic')

# plt.plot(x,x**3,label = 'cubic')

# plt.xlabel('x label')

# plt.ylabel('y label')

# plt.title('Simple Plot')

# plt.legend()

# plt.show()


# ## 通用模板

# # step1 準(zhǔn)備數(shù)據(jù)

# x = np.linspace(0,2,100)

# y = x**2

# # step2 設(shè)置繪圖樣式

# mpl.rc('lines',linewidth = 4,linestyle = '-.')

# # step3 定義布局

# fig,ax = plt.subplots()

# # step4 繪制圖像

# ax.plot(x,y,label = 'linear')

# # step5 添加標(biāo)簽、文字和圖例

# ax.set_xlabel('x label')

# ax.set_ylabel('y label')

# ax.set_title('Simple Plot')

# ax.legend();

## 思考題

# 1、請思考兩種繪圖模式的優(yōu)缺點(diǎn)和各自適合的使用場景

# 2、在第五節(jié)繪圖模板中我們是以O(shè)O模型作為例子展示的,請思考并寫一個pyplot繪圖模式的簡單模板

# 1

# (1)顯式創(chuàng)建適合需要創(chuàng)建多個圖時,自動創(chuàng)建適合只有一張圖時

# 2

# x = np.linspace(0,2,100)

# y = x**2

# plt.plot(x,y,label = 'linear')

# plt.xlabel('x label')

# plt.ylabel('y label')

# plt.title('自動創(chuàng)建')

# plt.legend()

# plt.show();

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 首先導(dǎo)入模塊 import numpy as npimport matplotlibimport matplotl...
    休提前事閱讀 1,209評論 0 0
  • 1、Matplotlib簡介 matplotlib是基于python語言的開源項目,旨在為python提供一個數(shù)據(jù)...
    國寶級初學(xué)者閱讀 3,098評論 0 0
  • 很多機(jī)器學(xué)習(xí)的問題都會涉及到有著幾千甚至數(shù)百萬維的特征的訓(xùn)練實例。這不僅讓訓(xùn)練過程變得非常緩慢,同時還很難找到一個...
    城市中迷途小書童閱讀 4,082評論 0 2
  • 1.使用matplotlib的pyplot模塊繪圖 pyplot 主要用于交互式繪圖和編程繪圖生成簡單圖例。 2....
    藍(lán)天下悠閑的云朵閱讀 889評論 0 0
  • 一、概述 深度學(xué)習(xí)的一個重要手段是訓(xùn)練數(shù)據(jù)和訓(xùn)練過程的可視化,因此,我們關(guān)于深度學(xué)習(xí)的系列介紹文章就從Matplo...
    aoqingy閱讀 6,567評論 0 24

友情鏈接更多精彩內(nèi)容