File:Interpolation-bilinear.svg
维基共享资源,媒体文件资料库
跳转到导航
跳转到搜索
此SVG文件的PNG预览的大小:450 × 450像素。 其他分辨率:240 × 240像素 | 480 × 480像素 | 768 × 768像素 | 1,024 × 1,024像素 | 2,048 × 2,048像素。
原始文件 (SVG文件,尺寸为450 × 450像素,文件大小:86 KB)
文件信息
结构化数据
说明
摘要
[编辑]描述Interpolation-bilinear.svg |
English: Illustration of Bilinear interpolation on a random dataset.
Compare with other interpolation methods that share the same dataset: File:Interpolation-bilinear.svg File:Interpolation-bicubic.svg File:Interpolation-hermite.svg |
日期 | |
来源 | 自己的作品 |
作者 | Zykure |
SVG开发 InfoField | 本矢量图使用Matplotlib创作。 |
源代码 InfoField | Python code#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams['font.size'] = 18
# Available interpolation methods:
# 'none', 'nearest', 'bilinear', 'bicubic', 'spline16',
# 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
# 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos'
METHODS = [ 'nearest', 'bilinear', 'bicubic', 'hermite' ]
FORMATS = [ 'png', 'pdf', 'svg' ]
COLORS = 'viridis'
N = 5
np.random.seed(1)
grid = np.arange(0, N, 1)
data = np.round(np.random.rand(N, N), 1)
mesh = np.meshgrid(grid, grid)
for interp in METHODS:
fig = plt.figure(figsize=(5,5))
ax = fig.add_axes([0.125, 0.175, 0.75, 0.75])
plt.imshow(data, interpolation=interp, cmap=COLORS, vmin=0, vmax=1)
plt.plot(mesh[0], mesh[1], marker='.', ms=8, color='k', lw=0)
plt.title(interp, weight='bold')
plt.xlim(grid.min()-0.5, grid.max()+0.5)
plt.ylim(grid.min()-0.5, grid.max()+0.5)
plt.xticks(grid)
plt.yticks(grid)
cax = fig.add_axes([0.125, 0.075, 0.75, 0.03])
cb = plt.colorbar(cax=cax, orientation='horizontal',
ticks=np.linspace(0, 1, 6))
cb.solids.set_edgecolor('face')
for ext in FORMATS:
plt.savefig("{}_{}.{}".format(sys.argv[0], interp, ext))
|
许可协议
[编辑]我,本作品著作权人,特此采用以下许可协议发表本作品:
本文件采用知识共享署名-相同方式共享 4.0 国际许可协议授权。
- 您可以自由地:
- 共享 – 复制、发行并传播本作品
- 修改 – 改编作品
- 惟须遵守下列条件:
- 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。
- 相同方式共享 – 如果您再混合、转换或者基于本作品进行创作,您必须以与原先许可协议相同或相兼容的许可协议分发您贡献的作品。
文件历史
点击某个日期/时间查看对应时刻的文件。
日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
---|---|---|---|---|---|
当前 | 2018年3月31日 (六) 23:57 | 450 × 450(86 KB) | Nicoguaro(留言 | 贡献) | Change colormap to viridis. | |
2016年9月1日 (四) 08:15 | 450 × 450(164 KB) | Zykure(留言 | 贡献) | User created page with UploadWizard |
您不可以覆盖此文件。
文件用途
以下页面使用本文件:
全域文件用途
以下其他wiki使用此文件:
- en.wikipedia.org上的用途
- es.wikipedia.org上的用途
- pl.wikipedia.org上的用途
- zh.wikipedia.org上的用途
元数据
此文件含有额外信息,这些信息可能是创建或数字化该文件时使用的数码相机或扫描仪所添加的。如果文件已从其原始状态修改,某些详细信息可能无法完全反映修改后的文件。
宽度 | 360pt |
---|---|
高度 | 360pt |