Skip to content
PostData Analysis / Data Visualization

DV-04-Data Mapping

2025-12-29
Back to Blog

DV-04-Data Mapping

Anscombe's quartet

Anscombe’s quartet(安斯库姆四重奏)
是一组四个不同的数据集
它们的统计特征几乎完全一样
画成图之后形态完全不同Sr3XUw 这四组数据 I、II、III、IV 都有:

  • 相同的 均值
  • 相同的 方差
  • 相同的 相关系数(ρ ≈ 0.816)
  • 甚至线性回归线也一样

Data-visual mapping

  • Numbers to position

Data coordinates, View volume coordinates,

Data coordinates represent the native value ranges of the dataset, while view volume coordinates define the region of the data space that the user chooses to visualize, which may be larger or smaller than the actual data range.


Normalized view coordinates

定义
Normalized view coordinates 是将 view volume 中的数据按比例缩放到标准区间 [0, 1]
使得数据表示与屏幕分辨率无关。

作用

  • 消除数据原始量纲和范围的影响
  • 作为数据到屏幕映射的中间统一坐标空间

线性归一化公式(课件公式)

x=xxvolminxvolmaxxvolmin,y=yyvolminyvolmaxyvolmin

其中:

  • xvolmin,xvolmax 为 view volume 在 x 方向的最小和最大值
  • x,y[0,1]

(当数据跨度很大时,也可使用 log scale 代替线性缩放)


Screen coordinates

定义
Screen coordinates 是将 normalized view coordinates 映射到具体屏幕或视口上的像素坐标

作用

  • 将与分辨率无关的 [0,1] 坐标转换为实际显示位置
  • 适配不同屏幕尺寸(如 1920×1080、1280×720)

设屏幕宽度为 W,高度为 H

xscreen=xWyscreen=yH

Affine Transformation

In-Class Exercise: Affine Transformation(公式总结)

1. 已知条件

Data / View volume coordinates

x[dxmin,dxmax]=[2,20],y[dymin,dymax]=[2,14]

Viewport (screen) coordinates

x[vxmin,vxmax]=[100,280],y[vymin,vymax]=[100,220]

2. 各步骤的变换参数

(1) 平移到原点

T(dxmin,dymin)=T(2,2)

(2) 缩放到单位空间(归一化)

Sdx=1dxmaxdxmin=118,Sdy=1dymaxdymin=112

(3) 缩放到视口大小

Svx=vxmaxvxmin=180,Svy=vymaxvymin=120

(4) 平移到视口原点

T(vxmin,vymin)=T(100,100)

3. 仿射变换组合公式(函数形式)

Q=T(vxmin,vymin)+S(Svx,Svy){S(Sdx,Sdy)[P+T(dxmin,dymin)]}

4. 齐次坐标矩阵形式(课堂最终结果)

[QxQy1]=[1010001100001][1800001200001][1180001120001][102012001][PxPy1]

5. 合并后的最终矩阵

[QxQy1]=[1008001080001][PxPy1]