二維圖形繪制方法
在使用 Notebook 環(huán)境繪圖時(shí),需要先運(yùn)行 Jupyter Notebook 的魔術(shù)命令 %matplotlib inline隙畜。這條命令的作用是將 Matplotlib 繪制的圖形嵌入在當(dāng)前頁面中议惰。而在桌面環(huán)境中繪圖時(shí)换淆,不需要添加此命令,而是在全部繪圖代碼之后追加 plt.show()讯屈。
%matplotlib inline
from matplotlib import pyplot as plt
簡(jiǎn)單圖形繪制
繪制一張簡(jiǎn)單的折線圖县习。
plt.plot([1, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1])
pyplot 模塊是 Matplotlib 最核心的模塊躁愿,幾乎所有樣式的 2D 圖形都是經(jīng)過該模塊繪制出來的彤钟。
如果你需要自定義橫坐標(biāo)值,只需要傳入兩個(gè)列表即可营搅。
plt.plot([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
[1, 2, 3, 2, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1])
繪制一張自定義 x, yx,y 的正弦曲線圖转质。
import numpy as np # 載入數(shù)值計(jì)算模塊
# 在 -2PI 和 2PI 之間等間距生成 1000 個(gè)值休蟹,也就是 X 坐標(biāo)
X = np.linspace(-2*np.pi, 2*np.pi, 1000)
# 計(jì)算 y 坐標(biāo)
y = np.sin(X)
# 向方法中 `*args` 輸入 X赂弓,y 坐標(biāo)
plt.plot(X, y)
pyplot.plot 在這里繪制的正弦曲線拣展,實(shí)際上不是嚴(yán)格意義上的曲線圖缔逛,而在兩點(diǎn)之間依舊是直線褐奴。這里看起來像曲線是因?yàn)闃颖军c(diǎn)相互挨得很近。
柱形圖
plt.bar([1, 2, 3], [1, 2, 3])
散點(diǎn)圖辅搬,比如堪遂,我們通過 GPS 采集的數(shù)據(jù)點(diǎn)溶褪,它會(huì)包含經(jīng)度以及緯度兩個(gè)值,這樣的情況就可以繪制成散點(diǎn)圖吹菱。
# X,y 的坐標(biāo)均有 numpy 在 0 到 1 中隨機(jī)生成 1000 個(gè)值
X = np.random.ranf(1000)
y = np.random.ranf(1000)
# 向方法中 `*args` 輸入 X鳍刷,y 坐標(biāo)
plt.scatter(X, y)
餅狀圖在有限列表以百分比呈現(xiàn)時(shí)特別有用输瓜,你可以很清晰地看出來各類別之間的大小關(guān)系蚌成,以及各類別占總體的比例。
plt.pie([1, 2, 3, 4, 5])
量場(chǎng)圖就是由向量組成的圖像,在氣象學(xué)等方面被廣泛應(yīng)用瓶盛。從圖像的角度來看惩猫,量場(chǎng)圖就是帶方向的箭頭符號(hào)蚜点。
X, y = np.mgrid[0:10, 0:10]
plt.quiver(X, y)
等高線圖
# 生成網(wǎng)格矩陣
x = np.linspace(-5, 5, 500)
y = np.linspace(-5, 5, 500)
X, Y = np.meshgrid(x, y)
# 等高線計(jì)算公式
Z = (1 - X / 2 + X ** 3 + Y ** 4) * np.exp(-X ** 2 - Y ** 2)
plt.contourf(X, Y, Z)
定義圖形樣式
二維線形圖參數(shù)
繪制一個(gè)三角函數(shù)圖形奶镶。
# 在 -2PI 和 2PI 之間等間距生成 1000 個(gè)值陪拘,也就是 X 坐標(biāo)
X = np.linspace(-2 * np.pi, 2 * np.pi, 1000)
# 計(jì)算 sin() 對(duì)應(yīng)的縱坐標(biāo)
y1 = np.sin(X)
# 計(jì)算 cos() 對(duì)應(yīng)的縱坐標(biāo)
y2 = np.cos(X)
# 向方法中 `*args` 輸入 X左刽,y 坐標(biāo)
plt.plot(X, y1, color='r', linestyle='--', linewidth=2, alpha=0.8)
plt.plot(X, y2, color='b', linestyle='-', linewidth=2)
散點(diǎn)圖參數(shù)
# 生成隨機(jī)數(shù)據(jù)
x = np.random.rand(100)
y = np.random.rand(100)
colors = np.random.rand(100)
size = np.random.normal(50, 60, 10)
plt.scatter(x, y, s=size, c=colors) # 繪制散點(diǎn)圖
餅狀圖也可以進(jìn)一步設(shè)置它的顏色迄靠、標(biāo)簽、陰影等各類樣式拭荤。
label = 'Cat', 'Dog', 'Cattle', 'Sheep', 'Horse' # 各類別標(biāo)簽
color = 'r', 'g', 'r', 'g', 'y' # 各類別顏色
size = [1, 2, 3, 4, 5] # 各類別占比
explode = (0, 0, 0, 0, 0.2) # 各類別的偏移半徑
# 繪制餅狀圖
plt.pie(size, colors=color, explode=explode,
labels=label, shadow=True, autopct='%1.1f%%')
# 餅狀圖呈正圓
plt.axis('equal')
組合圖形樣式
只需要將所需圖形的代碼放置在一起就可以了舅世,比如繪制一張包含柱形圖和折線圖的組合圖奇徒。
x = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
y_bar = [3, 4, 6, 8, 9, 10, 9, 11, 7, 8]
y_line = [2, 3, 5, 7, 8, 9, 8, 10, 6, 7]
plt.bar(x, y_bar)
plt.plot(x, y_line, '-o', color='y')
兩張圖的橫坐標(biāo)必須共享,才能夠被 Matplotlib 自動(dòng)判斷為組合圖效果罢低。
定義圖形位置
需要調(diào)整圖形的位置网持,或者把幾張單獨(dú)的圖形拼接在一起功舀。此時(shí)身弊,我們就需要引入 plt.figure 圖形對(duì)象了阱佛。
繪制一張自定義位置的圖形。
x = np.linspace(0, 10, 20) # 生成數(shù)據(jù)
y = x * x + 2
fig = plt.figure() # 新建圖形對(duì)象
axes = fig.add_axes([0.5, 0.5, 0.8, 0.8]) # 控制畫布的左, 下, 寬度, 高度
axes.plot(x, y, 'r')
figure 相當(dāng)于繪畫用的畫板翩蘸,而 axes 則相當(dāng)于鋪在畫板上的畫布催首。我們將圖像繪制在畫布上翅帜,于是就有了 plot命满,set_xlabel 等操作。
借助于圖形對(duì)象杂抽,我們可以實(shí)現(xiàn)大圖套小圖的效果韩脏。
fig = plt.figure() # 新建畫板
axes1 = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # 大畫布
axes2 = fig.add_axes([0.2, 0.5, 0.4, 0.3]) # 小畫布
axes1.plot(x, y, 'r') # 大畫布
axes2.plot(y, x, 'g') # 小畫布
使用 add_axes() 方法向我們?cè)O(shè)置的畫板 figure 中添加畫布 axes赡矢。在 Matplotlib 中吹散,還有一種添加畫布的方式,那就是 plt.subplots()刃唐,它和 axes 都等同于畫布画饥。
fig, axes = plt.subplots()
axes.plot(x, y, 'r')
借助于 plt.subplots()抖甘,我們就可以實(shí)現(xiàn)子圖的繪制与殃,也就是將多張圖按一定順序拼接在一起幅疼。
fig, axes = plt.subplots(nrows=1, ncols=2) # 子圖為 1 行爽篷,2 列
for ax in axes:
ax.plot(x, y, 'r')
通過設(shè)置 plt.subplots 的參數(shù)逐工,可以實(shí)現(xiàn)調(diào)節(jié)畫布尺寸和顯示精度漂辐。
fig, axes = plt.subplots(
figsize=(16, 9), dpi=50) # 通過 figsize 調(diào)節(jié)尺寸, dpi 調(diào)節(jié)顯示精度
axes.plot(x, y, 'r')
規(guī)范繪圖方法
首先髓涯,任何圖形的繪制,都建議通過 plt.figure() 或者 plt.subplots() 管理一個(gè)完整的圖形對(duì)象滑肉。而不是簡(jiǎn)單使用一條語句摘仅,例如 plt.plot(...) 來繪圖娃属。
管理一個(gè)完整的圖形對(duì)象,有很多好處掏击。在圖形的基礎(chǔ)上铐料,給后期添加圖例钠惩,圖形樣式族阅,標(biāo)注等預(yù)留了很大的空間坦刀。除此之外。代碼看起來也更加規(guī)范沐寺,可讀性更強(qiáng)混坞。
繪制包含圖標(biāo)題钢坦、坐標(biāo)軸標(biāo)題以及圖例的圖形
fig, axes = plt.subplots()
axes.set_xlabel('x label') # 橫軸名稱
axes.set_ylabel('y label')
axes.set_title('title') # 圖形名稱
axes.plot(x, x**2)
axes.plot(x, x**3)
axes.legend(["y = x**2", "y = x**3"], loc=0) # 圖例
圖例中的 loc 參數(shù)標(biāo)記圖例位置爹凹,1禾酱,2绘趋,3埋心,4 依次代表:右上角忙上、左上角疫粥、左下角,右下角项秉;0 代表自適應(yīng)
可以設(shè)置線的顏色娄蔼、透明度等其他屬性
fig, axes = plt.subplots()
axes.plot(x, x+1, color="red", alpha=0.5)
axes.plot(x, x+2, color="#1155dd")
axes.plot(x, x+3, color="#15cc55")
除了實(shí)線岁诉、虛線之外涕癣,還有很多豐富的線型可供選
fig, ax = plt.subplots(figsize=(12, 6))
# 線寬
ax.plot(x, x+1, color="blue", linewidth=0.25)
ax.plot(x, x+2, color="blue", linewidth=0.50)
ax.plot(x, x+3, color="blue", linewidth=1.00)
ax.plot(x, x+4, color="blue", linewidth=2.00)
# 虛線類型
ax.plot(x, x+5, color="red", lw=2, linestyle='-')
ax.plot(x, x+6, color="red", lw=2, ls='-.')
ax.plot(x, x+7, color="red", lw=2, ls=':')
# 虛線交錯(cuò)寬度
line, = ax.plot(x, x+8, color="black", lw=1.50)
line.set_dashes([5, 10, 15, 10])
# 符號(hào)
ax.plot(x, x + 9, color="green", lw=2, ls='--', marker='+')
ax.plot(x, x+10, color="green", lw=2, ls='--', marker='o')
ax.plot(x, x+11, color="green", lw=2, ls='--', marker='s')
ax.plot(x, x+12, color="green", lw=2, ls='--', marker='1')
# 符號(hào)大小和顏色
ax.plot(x, x+13, color="purple", lw=1, ls='-', marker='o', markersize=2)
ax.plot(x, x+14, color="purple", lw=1, ls='-', marker='o', markersize=4)
ax.plot(x, x+15, color="purple", lw=1, ls='-',
marker='o', markersize=8, markerfacecolor="red")
ax.plot(x, x+16, color="purple", lw=1, ls='-', marker='s', markersize=8,
markerfacecolor="yellow", markeredgewidth=2, markeredgecolor="blue")
我們可能需要顯示畫布網(wǎng)格或調(diào)整坐標(biāo)軸范圍坠韩。設(shè)置畫布網(wǎng)格和坐標(biāo)軸范圍只搁。這里俭尖,我們通過指定 axes[0] 序號(hào)目溉,來實(shí)現(xiàn)子圖的自定義順序排列缭付。
fig, axes = plt.subplots(1, 2, figsize=(10, 5))
# 顯示網(wǎng)格
axes[0].plot(x, x**2, x, x**3, lw=2)
axes[0].grid(True)
# 設(shè)置坐標(biāo)軸范圍
axes[1].plot(x, x**2, x, x**3)
axes[1].set_ylim([0, 60])
axes[1].set_xlim([2, 5])
繪制由散點(diǎn)圖陷猫、梯步圖、條形圖绣檬、面積圖構(gòu)成的子圖娇未。
n = np.array([0, 1, 2, 3, 4, 5])
fig, axes = plt.subplots(1, 4, figsize=(16, 5))
axes[0].scatter(x, x + 0.25*np.random.randn(len(x)))
axes[0].set_title("scatter")
axes[1].step(n, n**2, lw=2)
axes[1].set_title("step")
axes[2].bar(n, n**2, align="center", width=0.5, alpha=0.5)
axes[2].set_title("bar")
axes[3].fill_between(x, x**2, x**3, color="green", alpha=0.5)
axes[3].set_title("fill_between")
圖形標(biāo)注方法
圖像標(biāo)注零抬,就是在畫面上添加文字注釋、指示箭頭蝶棋、圖框等各類標(biāo)注元素玩裙。
文字標(biāo)注的方法由 matplotlib.pyplot.text() 實(shí)現(xiàn)吃溅。最基本的樣式為 matplotlib.pyplot.text(x, y, s)坷牛,其中 x, y 用于標(biāo)注位置定位京闰,s 代表標(biāo)注的字符串。除此之外俏站,你還可以通過 fontsize= , horizontalalignment= 等參數(shù)調(diào)整標(biāo)注字體的大小肄扎,對(duì)齊樣式等赁酝。
對(duì)柱形圖進(jìn)行文字標(biāo)注
fig, axes = plt.subplots()
x_bar = [10, 20, 30, 40, 50] # 柱形圖橫坐標(biāo)
y_bar = [0.5, 0.6, 0.3, 0.4, 0.8] # 柱形圖縱坐標(biāo)
bars = axes.bar(x_bar, y_bar, color='blue', label=x_bar, width=2) # 繪制柱形圖
for i, rect in enumerate(bars):
x_text = rect.get_x() # 獲取柱形圖橫坐標(biāo)
y_text = rect.get_height() + 0.01 # 獲取柱子的高度并增加 0.01
plt.text(x_text, y_text, '%.1f' % y_bar[i]) # 標(biāo)注文字
除了文字標(biāo)注之外酌呆,還可以通過 matplotlib.pyplot.annotate() 方法向圖像中添加箭頭等樣式標(biāo)注隙袁。
fig, axes = plt.subplots()
bars = axes.bar(x_bar, y_bar, color='blue', label=x_bar, width=2) # 繪制柱形圖
for i, rect in enumerate(bars):
x_text = rect.get_x() # 獲取柱形圖橫坐標(biāo)
y_text = rect.get_height() + 0.01 # 獲取柱子的高度并增加 0.01
plt.text(x_text, y_text, '%.1f' % y_bar[i]) # 標(biāo)注文字
# 增加箭頭標(biāo)注
plt.annotate('Min', xy=(32, 0.3), xytext=(36, 0.3),
arrowprops=dict(facecolor='black', width=1, headwidth=7))
xy=() 表示標(biāo)注終點(diǎn)坐標(biāo)弃榨,xytext=() 表示標(biāo)注起點(diǎn)坐標(biāo)鲸睛。在箭頭繪制的過程中坡贺,arrowprops=() 用于設(shè)置箭頭樣式拴念,facecolor= 設(shè)置顏色,width= 設(shè)置箭尾寬度风瘦,headwidth= 設(shè)置箭頭寬度万搔,可以通過 arrowstyle= 改變箭頭的樣式官帘。
兼容 MATLAB 代碼風(fēng)格接口
from matplotlib import pylab
x = np.linspace(0, 10, 20)
y = x * x + 2
pylab.plot(x, y, 'r') # 'r' 代表 red
如果我們要繪制子圖刽虹,就可以使用 subplot 方法繪制子圖:
pylab.subplot(1, 2, 1) # 括號(hào)中內(nèi)容代表(行,列胖缤,索引)
pylab.plot(x, y, 'r--') # ‘’ 中的內(nèi)容確定了顏色和線型
pylab.subplot(1, 2, 2)
pylab.plot(y, x, 'g*-')
嘗試通過 Matplotlib 繪制出下圖這副圖像
import numpy as np
import matplotlib.pyplot as plt
plt.figure(figsize=(8, 5), dpi=80)
ax = plt.subplot(111)
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data', 0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data', 0))
X = np.linspace(-np.pi, np.pi, 256, endpoint=True)
C, S = np.cos(X), np.sin(X)
plt.plot(X, C, color="blue", linewidth=2.5, linestyle="-", label="Cos Function")
plt.plot(X, S, color="red", linewidth=2.5, linestyle="-", label="Sin Function")
plt.xlim(X.min() * 1.1, X.max() * 1.1)
plt.xticks([-np.pi, -np.pi / 2, 0, np.pi / 2, np.pi],
[r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$'])
plt.ylim(C.min() * 1.1, C.max() * 1.1)
plt.yticks([-1, +1],
[r'$-1$', r'$+1$'])
t = 2 * np.pi / 3
plt.plot([t, t], [0, np.cos(t)],
color='blue', linewidth=1.5, linestyle="--")
plt.scatter([t, ], [np.cos(t), ], 50, color='blue')
plt.annotate(r'$\sin(\frac{2\pi}{3})=\frac{\sqrt{3}}{2}$',
xy=(t, np.sin(t)), xycoords='data',
xytext=(+10, +30), textcoords='offset points', fontsize=16,
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))
plt.plot([t, t], [0, np.sin(t)],
color='red', linewidth=1.5, linestyle="--")
plt.scatter([t, ], [np.sin(t), ], 50, color='red')
plt.annotate(r'$\cos(\frac{2\pi}{3})=-\frac{1}{2}$',
xy=(t, np.cos(t)), xycoords='data',
xytext=(-90, -50), textcoords='offset points', fontsize=16,
arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))
plt.legend(loc='upper left', frameon=False)
plt.show()
三維圖形繪制方法
三維圖形繪制
繪制三維圖像主要通過 mplot3d 模塊實(shí)現(xiàn)。但是涡真,使用 Matplotlib 繪制三維圖像實(shí)際上是在二維畫布上展示肾筐,所以一般繪制三維圖像時(shí),同樣需要載入 pyplot 模塊剧劝。
mplot3d 模塊下主要包含 4 個(gè)大類讥此,分別是:
mpl_toolkits.mplot3d.axes3d()
mpl_toolkits.mplot3d.axis3d()
mpl_toolkits.mplot3d.art3d()
mpl_toolkits.mplot3d.proj3d()
axes3d() 下面主要包含了各種實(shí)現(xiàn)繪圖的類和方法萄喳。axis3d() 主要是包含了和坐標(biāo)軸相關(guān)的類和方法。art3d() 包含了一些可將 2D 圖像轉(zhuǎn)換并用于 3D 繪制的類和方法他巨。proj3d() 中包含一些零碎的類和方法染突,例如計(jì)算三維向量長(zhǎng)度等份企。
一般情況下司志,我們用到最多的就是 mpl_toolkits.mplot3d.axes3d() 下面的 mpl_toolkits.mplot3d.axes3d.Axes3D() 類,而 Axes3D() 下面又存在繪制不同類型 3D 圖的方法骂远。
三維散點(diǎn)圖的繪制
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
%matplotlib inline
# x, y, z 均為 100 個(gè)隨機(jī)數(shù)
x = np.random.normal(0, 1, 100)
y = np.random.normal(0, 1, 100)
z = np.random.normal(0, 1, 100)
fig = plt.figure()
ax = Axes3D(fig)
ax.scatter(x, y, z)
三維圖形和二維圖形在數(shù)據(jù)上的區(qū)別在于激才,三維圖形多了一組數(shù)據(jù)用于度量多出來的一個(gè)維度瘸恼。
當(dāng)我們?cè)谧烂姝h(huán)境中繪制 3D 圖形時(shí)岩睁,是可以通過鼠標(biāo)任意拖動(dòng)角度的捕儒,但在 Jupyter Notebook 環(huán)境中不支持,只會(huì)展示三維圖形的默認(rèn)視角靜態(tài)圖像刘莹。
線形圖和散點(diǎn)圖相似点弯,需要傳入 x, y, zx,y,z 三個(gè)坐標(biāo)的數(shù)值。
# 生成數(shù)據(jù)
x = np.linspace(-6 * np.pi, 6 * np.pi, 1000)
y = np.sin(x)
z = np.cos(x)
# 創(chuàng)建 3D 圖形對(duì)象
fig = plt.figure()
ax = Axes3D(fig)
ax.plot(x, y, z)
繪制三維柱狀圖
# 創(chuàng)建 3D 圖形對(duì)象
fig = plt.figure()
ax = Axes3D(fig)
# 生成數(shù)據(jù)并繪圖
x = [0, 1, 2, 3, 4, 5, 6]
for i in x:
y = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
z = abs(np.random.normal(1, 10, 10))
ax.bar(y, z, i, zdir='y', color=['r', 'g', 'b', 'y'])
對(duì)數(shù)據(jù)進(jìn)行矩陣處理狼钮。其實(shí)和畫二維等高線圖很相似,只是多增加了一個(gè)維度莲镣。
# 創(chuàng)建 3D 圖形對(duì)象
fig = plt.figure()
ax = Axes3D(fig)
# 生成數(shù)據(jù)
X = np.arange(-2, 2, 0.1)
Y = np.arange(-2, 2, 0.1)
X, Y = np.meshgrid(X, Y)
Z = np.sqrt(X ** 2 + Y ** 2)
# 繪制曲面圖瑞侮,并使用 cmap 著色
ax.plot_surface(X, Y, Z, cmap=plt.cm.winter)
cmap=plt.cm.winter 表示采用了 winter 配色方案半火。除了通過 Axes3D() 聲明三維圖形季俩,我們也可以通過 projection='3d' 參數(shù)聲明 3D 圖形种玛。
fig = plt.figure(figsize=(14, 6))
# 通過 projection='3d' 聲明繪制 3D 圖形
ax = fig.add_subplot(1, 2, 1, projection='3d')
ax.plot_surface(X, Y, Z, cmap=plt.cm.winter)
三維混合圖
混合圖就是將兩種不同類型的圖繪制在一張圖里。繪制混合圖一般有前提條件娱节,那就是兩種不同類型圖的范圍大致相同肄满,否則將會(huì)出現(xiàn)嚴(yán)重的比例不協(xié)調(diào)稠歉,而使得混合圖失去意義汇陆。
# 創(chuàng)建 3D 圖形對(duì)象
fig = plt.figure()
ax = Axes3D(fig)
# 生成數(shù)據(jù)并繪制圖 1
x1 = np.linspace(-3 * np.pi, 3 * np.pi, 500)
y1 = np.sin(x1)
ax.plot(x1, y1, zs=0, c='red')
# 生成數(shù)據(jù)并繪制圖 2
x2 = np.random.normal(0, 1, 100)
y2 = np.random.normal(0, 1, 100)
z2 = np.random.normal(0, 1, 100)
ax.scatter(x2, y2, z2)
三維子圖
可以將二維圖像和三維圖像繪制在一起阅羹,又或者將幾個(gè)三維圖像繪制在一起捏鱼。
# 創(chuàng)建 1 張畫布
fig = plt.figure(figsize=(8, 4))
# 向畫布添加子圖 1
ax1 = fig.add_subplot(1, 2, 1, projection='3d')
# 生成子圖 1 數(shù)據(jù)
x = np.linspace(-6 * np.pi, 6 * np.pi, 1000)
y = np.sin(x)
z = np.cos(x)
# 繪制第 1 張圖
ax1.plot(x, y, z)
# 向畫布添加子圖 2
ax2 = fig.add_subplot(1, 2, 2, projection='3d')
# 生成子圖 2 數(shù)據(jù)
X = np.arange(-2, 2, 0.1)
Y = np.arange(-2, 2, 0.1)
X, Y = np.meshgrid(X, Y)
Z = np.sqrt(X ** 2 + Y ** 2)
# 繪制第 2 張圖
ax2.plot_surface(X, Y, Z, cmap=plt.cm.winter)