ILNumerics 中的控制等高线图 X 和 Y 轴
control contour plot X and Y axis in ILNumerics
使用 Surface 时,我可以将 X 轴和 Y 轴的网格传递给构造函数:
Array<float> z = new float[,]
{
{1, 2, 3 },
{4, 5, 6 }
};
Array<float> x = new float[,]
{
{-0.5f, 0, 0.5f },
};
Array<float> y = new float[,]
{
{-10, -1 },
};
var linSurface = new Surface(z, x, y, colormap: Colormaps.Hsv);
var linContour = new ContourPlot(z, colormap: Colormaps.Hsv);
我可以为 ContourPlot 做类似的事情(控制 X 和 Y 轴)吗?
ContourPlot 目前没有为 X 或 Y 值指定自定义坐标的选项。但是,您可以使用技巧 'move' 等高线图到自定义位置。为了让它工作,将 ContourPlot 放入组节点中。组允许将其内容翻译到任意位置。它们还允许拉伸内容。
例如,为 X 创建轴范围 [10...110],为 Y 创建轴范围 [20,220]
(伪代码,未测试):
var linContour = new Group(
scale: new Vector3(100, 200, 0),
translate: new Vector3(10,20,1)) {
new ContourPlot(z, colormap: Colormaps.Hsv)
};
使用 Surface 时,我可以将 X 轴和 Y 轴的网格传递给构造函数:
Array<float> z = new float[,]
{
{1, 2, 3 },
{4, 5, 6 }
};
Array<float> x = new float[,]
{
{-0.5f, 0, 0.5f },
};
Array<float> y = new float[,]
{
{-10, -1 },
};
var linSurface = new Surface(z, x, y, colormap: Colormaps.Hsv);
var linContour = new ContourPlot(z, colormap: Colormaps.Hsv);
我可以为 ContourPlot 做类似的事情(控制 X 和 Y 轴)吗?
ContourPlot 目前没有为 X 或 Y 值指定自定义坐标的选项。但是,您可以使用技巧 'move' 等高线图到自定义位置。为了让它工作,将 ContourPlot 放入组节点中。组允许将其内容翻译到任意位置。它们还允许拉伸内容。
例如,为 X 创建轴范围 [10...110],为 Y 创建轴范围 [20,220] (伪代码,未测试):
var linContour = new Group(
scale: new Vector3(100, 200, 0),
translate: new Vector3(10,20,1)) {
new ContourPlot(z, colormap: Colormaps.Hsv)
};