c#源码,将矩阵(二维数组)渲染成云图,强度图,热力图,均匀性图,伪彩图

nter先直接上C#软件效果图
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1、二维数据最小支持2*2,
2、渲染时间60ms左右,速度快,
3、纯粹的C#代码编写,不含第三方dll或者控件
4、支持ColorBar显示,强度值颜色坐标显示
5、整图保存为单个图片
6、渲染效果良好,颜色均匀分布,不存在等高线,交叉点
7、采样全新数据插值算法

CSDN软件0积分下载链接:https://download.csdn.net/download/wanghuannihao1992/86656759

下面看几组其他软件做出来的效果(一般做简单的二维线性插值):

matlab效果
在这里插入图片描述
Labview效果Labview
网格图在这里插入图片描述

下面为Matlab官网关于二维线性插值的一些资料(可忽略,本人不是采样这个方法)
interp2
Two-dimensional data interpolation (table lookup)

Syntax
ZI = interp2(X,Y,Z,XI,YI)
ZI = interp2(Z,XI,YI)
ZI = interp2(Z,ntimes)
ZI = interp2(X,Y,Z,XI,YI,method)
ZI = interp2(…,method, extrapval)
Description
ZI = interp2(X,Y,Z,XI,YI) returns matrix ZI containing elements corresponding to the elements of XI and YI and determined by interpolation within the two-dimensional function specified by matrices X, Y, and Z. X and Y must be monotonic, and have the same format (“plaid”) as if they were produced by meshgrid. Matrices X and Y specify the points at which the data Z is given. Out of range values are returned as NaNs.

XI and YI can be matrices, in which case interp2 returns the values of Z corresponding to the points (XI(i,j),YI(i,j)). Alternatively, you can pass in the row and column vectors xi and yi, respectively. In this case, interp2 interprets these vectors as if you issued the command meshgrid(xi,yi).

ZI = interp2(Z,XI,YI) assumes that X = 1:n and Y = 1:m, where [m,n] = size(Z).

ZI = interp2(Z,ntimes) expands Z by interleaving interpolates between every element, working recursively for ntimes. interp2(Z) is the same as interp2(Z,1).

ZI = interp2(X,Y,Z,XI,YI,method) specifies an alternative interpolation method:

‘nearest’
Nearest neighbor interpolation
‘linear’
Bilinear interpolation (default)
‘spline’
Cubic spline interpolation
‘cubic’
Bicubuc interpolation
All interpolation methods require that X and Y be monotonic, and have the same format (“plaid”) as if they were produced by meshgrid. If you provide two monotonic vectors, interp2 changes them to a plaid internally. Variable spacing is handled by mapping the given values in X, Y, XI, and YI to an equally spaced domain before interpolating. For faster interpolation when X and Y are equally spaced and monotonic, use the methods ‘*linear’, ‘*cubic’, ‘*spline’, or ‘*nearest’.

ZI = interp2(…,method, extrapval) specifies a method and a scalar value for ZI outside of the domain created by X and Y. Thus, ZI equals extrapval for any value of YI or XI that is not spanned by Y or X respectively. A method must be specified to use extrapval. The default method is ‘linear’.

Remarks
The interp2 command interpolates between data points. It finds values of a two-dimensional function underlying the data at intermediate points.

Interpolation is the same operation as table lookup. Described in table lookup terms, the table is tab = [NaN,Y; X,Z] and interp2 looks up the elements of XI in X, YI in Y, and, based upon their location, returns values ZI interpolated within the elements of Z.

Examples
Example 1. Interpolate the peaks function over a finer grid.

[X,Y] = meshgrid(-3:.25:3);
Z = peaks(X,Y);
[XI,YI] = meshgrid(-3:.125:3);
ZI = interp2(X,Y,Z,XI,YI);
mesh(X,Y,Z), hold, mesh(XI,YI,ZI+15)
hold off
axis([-3 3 -3 3 -5 20])

Example 2. Given this set of employee data,

years = 1950:10:1990;
service = 10:10:30;
wage = [150.697 199.592 187.625
179.323 195.072 250.287
203.212 179.092 322.767
226.505 153.706 426.730
249.633 120.281 598.243];
it is possible to interpolate to find the wage earned in 1975 by an employee with 15 years’ service:

w = interp2(service,years,wage,15,1975)
w =
190.6287

  • 3
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

没错,我是

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值