无法使用调色板用颜色填充对象 [英] Can't use palette to fill object with colour

查看:75
本文介绍了无法使用调色板用颜色填充对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图绘制正方形格子中的粒子数。我需要给每个人涂上不同的颜色。因此,我尝试使用调色板..通过选择一些随机数,但是它总是给我黑色矩形..我该怎么办?

I was trying to plot number of particles in a square lattice. and I need each one to be coloured different. So I tried using palette.. by picking some random numbers but it always gives me black rectangles.. what should I do?

将obj rect从1,5设置为2 ,6 fc调色板0.454545→这对我不起作用。

set obj rect from 1,5 to 2,6 fc palette 0.454545 → this is what is not working for me.

这是所有相同颜色的图像。我需要为每个粒子使用不同的颜色:

This is the image with all same color. I need different colour for each particle:

推荐答案

使用绘制boxxyerror 样式,并填充框:

set size ratio -1
set style fill solid
plot 'file.dat' using 1:2:(0.1):(0.1):3 linecolor palette with boxxyerror

$ b填充实线
图'file.dat'
$ b

这将在第一列和第二列给出的每个位置上绘制一个大小为0.2的正方形。颜色取自第三列,并映射到当前调色板。您必须使其适应实际的数据格式。

This would plot a square of size 0.2 at each position given by the first and second columns. The color is taken from the third column and mapped to the current palette. You must adapt that to your actual data format.

使用随机伪数据('+')的工作示例:

Working example using random pseudo-data ('+'):

set xrange [-0.05:1.05]
f = "int(rand(0) * 20)/20.0"
set style fill solid
set size ratio -1
plot '+' using (@f):(@f):(0.025):(0.025):(@f) linecolor palette notitle with boxxyerror

这篇关于无法使用调色板用颜色填充对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆