wolfram-mathematica - Gnuplot 和 Mathematica 中的颜色图

标签 wolfram-mathematica gnuplot

我有一个包含三列的数据文件。我想绘制(第一个,第二个)并使用第三个来生成颜色图。也就是说,平原中的每个点所采用的颜色取决于第三列中的值。

使用 Gnuplot,我可以轻松做到这一点:

gnuplot> set palette rgbformulae 33,13,10
plot "output.dat" using 1:2:3  with points palette

对于一组数据,我得到如下结果: enter image description here

现在,在 Mathematica 中是否有一种简单的方法可以做到这一点?

最佳答案

您可以从图形基元构建它:

data = RandomReal[1, {20, 3}];

(* rescale 3rd column to be between 0 and 1, if needed *)
data[[All, 3]] = Rescale[data[[All, 3]]];

Graphics[{PointSize[.03], {ColorData["ThermometerColors"][#3], Point[{#1, #2}]} & @@@ data}]

Mathematica graphics

关于颜色条:

内置的颜色条功能并不出色。您可以阅读有关它的here 。有一个替代实现 hereMy question here可能也有用。

关于wolfram-mathematica - Gnuplot 和 Mathematica 中的颜色图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10457452/

相关文章:

python - 如何使带有两个for循环的python代码运行得更快(有没有一种python方法可以进行Mathematica的并行化)?

python - 使 pyplot 比 gnuplot 更快

linux - 为什么我的命令对 gnuplot 不起作用?

plot - 修改 csv 中的字符串输入以确定前导符号

Gnuplot:找到给定 x 值的 y 值

wolfram-mathematica - 在 Mathematica 中计算相对频率

latex - 从网站导出文本、图像和 LaTeX 方程式

wolfram-mathematica - 是否有内置的 Mathematica 函数来读取 0-9,a-f 格式的十六进制?

wolfram-mathematica - Mathematica 中 Manipulate[] 的自定义 Controller

ruby - 使用 ruby​​_gnuplot 在 Ruby 中制作动画 3d 散点图