颜色模式或函数,pyxplot
我正在使用一个名为 pyxplot 的程序,并且正在制作一些颜色图。 为了指定颜色,我可以使用 RGB、HSB 或 CMYK 模式,使用
set colourmap ( rgb<r>:<g>:<b> |
hsb<h>:<s>:<b> |
cmyk<c>:<m>:<y>:<k> )
“所有值从 0 到 1”并指定 f(x,y) = c1 函数的颜色。 例如,我可以这样做
set colourmap rgb(c1):(0):(0)
,它给了我一个从白色到红色的颜色图(红色代表 c1 的值为 1,白色代表 0) 我想知道是否有人有想法形成一些颜色图案(或者是否有人有一些参考),例如本页Matlab的“jet”http://www.mathworks.com/help/techdoc/ref/colormapeditor.html 因为我尝试组合颜色,但无法获得漂亮的图案。
我可以这样做
set colourmap hsb(0.5*c1+0.1):(1):(1)
,它为我提供了从橙色到蓝色的 hsb 颜色范围,但是,如果我想要该范围内的其他颜色怎么办?
I'm using a program called pyxplot and I'm doing some colourmaps.
To specify the colors, I can use RGB, HSB or CMYK patterns using
set colourmap ( rgb<r>:<g>:<b> |
hsb<h>:<s>:<b> |
cmyk<c>:<m>:<y>:<k> )
All values goes from 0 to 1 and that specifies a color for the f(x,y) = c1 function.
For example, I can do
set colourmap rgb(c1):(0):(0)
and it gives me a colourmap from white to red (red for values of c1 that are 1, white for 0)
I want to know if someone has an idea to form some color patterns (or if someone has some reference) like the 'jet' of Matlab of this page http://www.mathworks.com/help/techdoc/ref/colormapeditor.html
Because I try to combine colors but i can't get nice patterns.
I could do
set colourmap hsb(0.5*c1+0.1):(1):(1)
and it gives me from orange to blue on hsb range of colours, but, what if I want other colours in the range?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你说得很对,过去在 Pyxplot 0.8 中生成自定义色标并不容易。但现在在 0.9 版本中可以做到这一点。
您需要设置一个调色板,其中包含您想要的颜色列表。然后,不要根据 RGB 或 HSB 分量设置颜色图,而是将其设置为整数,以从当前调色板中读取颜色。如果您的调色板中有五种颜色,您需要:
有关详细信息,包括示例,请参阅
http://pyxplot.org.uk/current/doc/html/sec -palette.html
You're quite right that it didn't used to be very easy to produce custom color scales in Pyxplot 0.8. But it is now possible to do it in version 0.9.
You need to set up a palette with a list of the colors you want along your scale. Then, rather than setting a color map in terms of RGB or HSB components, set it as an integer, to read a color from the present palette. If your palette has five colors in it, you want:
For more information, including an example, see
http://pyxplot.org.uk/current/doc/html/sec-palette.html
您可以使用颜色之间线性插值的颜色图:
深蓝色 (0,0,0.5)、蓝色 (0,0,1)、青色 (0,1,1)、黄色 (1,1,0)、红色 (1,0,0)、深红色 (0.5) ,0,0)。
这主要是类似“jet”的颜色图(如果省略深蓝色和深红色),但看起来更有趣。 MathGL(GPL 绘图库)中默认使用的正是这种配色方案。
You can use a colormap of linear interpolation between colors:
dark blue (0,0,0.5), blue (0,0,1), cyan (0,1,1), yellow (1,1,0), red (1,0,0), dark red (0.5,0,0).
This is mostly the "jet" like colormap (if you omit dark blue and dark red colors) but look a bit more interesting. Exactly this color scheme is used by default in MathGL (GPL plotting library).
HSB 可能是最好、最容易使用的颜色系统,特别是您尝试过的色调 (H) 组件。它应该从红色开始,然后是黄色、绿色、青色、蓝色、洋红色,然后返回红色。
如果将颜色图简化为(假设 c1 从 0 到 1),您应该可以轻松获得其他颜色:
H 分量的当前公式 0.5 * c1 + 0.1将其限制在从橙色到黄色、绿色、青色到蓝色的范围内。
HSB is probably the best and easiest color system to play with, in particular the Hue (H) component as you tried. It should start with red, continue with yellow, green, cyan, blue, magenta and return to red.
You should easily get the other colors if you simplify your colormap to (assuming that c1 goes from 0 to 1):
The current formula 0.5 * c1 + 0.1 for the H component restricts it to the range from orange via yellow, green and cyan to blue.