【问题标题】:White area in Mathematica ListPlotMathematica ListPlot 中的白色区域
【发布时间】:2011-08-12 15:33:39
【问题描述】:

当我创建和绘制这个列表时:

var = 2;
okList = {{0.8, var, 0.8, 0.8}, {0, 0.3, 0.6, 0.9}, {0, 1, 2, 3}};
lp = ListDensityPlot[okList, ColorFunction -> "SandyTerrain"]

或者,未缩放,像这样:

lp = ListDensityPlot[okList, ColorFunction -> "SandyTerrain",
     ColorFunctionScaling -> False]

正如我所料,我得到了一个全彩色方块。

但是当我尝试这个时:

var = 0.8;
list = {{0.8, var, 0.8, 0.8}, {0, 0.3, 0.6, 0.9}, {0, 1, 2, 3}};
problem = ListDensityPlot[list, ColorFunction -> "SandyTerrain"]

我在角落里发现了一块白斑。

使用 ColorFunctionScaling->False 绘图并没有摆脱

ColorFunction SandyTerrain 中没有任何白色,所以这一定是 ListDensityPlot 不在该区域绘制任何东西。

什么可能导致这种情况发生,我该如何阻止它?

【问题讨论】:

    标签: graph wolfram-mathematica plot mathematica-8


    【解决方案1】:

    它被自动绘图范围计算剪裁了。试试PlotRange -> AllClippingStyle -> Automatic

    【讨论】:

    • 两者都有效,但结果图略有不同。你知道为什么吗?
    • 在我的系统(OS X 上的 V8.0.1)上,ClippingStyle -> Automatic 没有明显改变颜色。 PlotRange -> All 确实如此,因为增加的范围会影响由ColorFunctionScaling -> True 缩放到 [0,1] 的范围。
    猜你喜欢
    • 1970-01-01
    • 2012-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-30
    • 1970-01-01
    • 2012-09-26
    • 1970-01-01
    相关资源
    最近更新 更多