python matplotlib中的一些引數問題

2021-10-12 17:18:59 字數 749 閱讀 4258

import numpy as np

import matplotlib.pyplot as plt

# 生成x軸上的資料:從-1到1,總共有50個點

x = np.linspace(-1

,1,50

)# 定義乙個線性方程

y1 =

3* x

# 定義乙個二次方程

y2 = x **

3# 設定x軸的取值範圍為:-2到2

plt.xlim(-2

,2)# 設定y軸的取值範圍為:-2到3

plt.ylim(-2

,3)# 設定x軸的文字,用於描述x軸代表的是什麼

plt.xlabel(

"i am x"

)# 設定y軸的文字,用於描述y軸代表的是什麼

plt.ylabel(

"i am y"

)# 按預設繪製二次方程

plt.plot(x, y2)

# 繪製紅色的線寬為1虛線的線條,線性方程

plt.plot(x, y1, color=

'red'

, linewidth=

1.0, linestyle=

'--'

)# 顯示圖表

plt.show(

)

結果:

Parallels Desktop 的一些問題

並且無法進行su命令,提示 authentication failure。這個問題產生的原因是由於系統預設是沒有啟用root使用者的,需要我們手工進行操作,在命令列介面下,或者在終端中輸入如下命令 sudo passwd password 你當前的密碼 enter new unix password...

PHP中 SERVER的一些引數

server php self 當前正在執行 指令碼的檔名,與 document root相關。server argv 傳遞給該 指令碼的引數。server argc 包含傳遞給程式的 命令列引數的個數 如果執行在命令列模式 server gateway inte ce 伺服器使用的 cgi 規範的...

caffe 中的一些引數介紹

net models bvlc alexnet train val.prototxt test iter 1000 test interval 1000 base lr 0.01 開始的學習率 lr policy step 學習率的drop是以gamma在每一次迭代中 gamma 0.1 steps...