Redian新闻
>
[转载] gnuplot中的颜色问题
avatar
[转载] gnuplot中的颜色问题# Unix - 噫吁兮,危乎高哉
l*a
1
【 以下文字转载自 Science 讨论区 】
【 原文由 litza 所发表 】
偶用gnuplot画图, 三条curve按出现的先后顺序分别
会是red, green, blue. That's the default setting
in gnuplot.
请问如何能customize gnuplot中的颜色设置呢?比如
偶想让第一条curve是 blue, 第二条curve是red, etc.
google了很久,发现这问题牵连到 .Xdefaults, X11的
一堆东西. Could anyone have experience on this
give some sample .Xdefaults/.gnuplot file? Thanks
a lot!
avatar
A*o
2
in your home directory .Xdefaults (if u don't have one, create one)
append
gnuplot*background: white
gnuplot*textColor: black
gnuplot*borderColor: black
gnuplot*axisColor: black
gnuplot*line1Color: red
gnuplot*line2Color: green
gnuplot*line3Color: yellow
gnuplot*line4Color: magenta
gnuplot*line5Color: cyan
gnuplot*line6Color: sienna
gnuplot*line7Color: orange
gnuplot*line8Color: coral
then, log out and re-login
or, xrdb -merge .Xdefaults

【在 l***a 的大作中提到】
: 【 以下文字转载自 Science 讨论区 】
: 【 原文由 litza 所发表 】
: 偶用gnuplot画图, 三条curve按出现的先后顺序分别
: 会是red, green, blue. That's the default setting
: in gnuplot.
: 请问如何能customize gnuplot中的颜色设置呢?比如
: 偶想让第一条curve是 blue, 第二条curve是red, etc.
: google了很久,发现这问题牵连到 .Xdefaults, X11的
: 一堆东西. Could anyone have experience on this
: give some sample .Xdefaults/.gnuplot file? Thanks

avatar
l*a
3
it works! Thanks a lot!

【在 A*****o 的大作中提到】
: in your home directory .Xdefaults (if u don't have one, create one)
: append
: gnuplot*background: white
: gnuplot*textColor: black
: gnuplot*borderColor: black
: gnuplot*axisColor: black
: gnuplot*line1Color: red
: gnuplot*line2Color: green
: gnuplot*line3Color: yellow
: gnuplot*line4Color: magenta

avatar
l*a
4
when giving a first plotting command in gnuplot after .Xdefaults is setup,
gnuplot may give the following complain --
gnuplot> plot sin(cos(x))
gnuplot: can't allocate 'sienna'. Using black.
gnuplot: can't allocate 'orange'. Using black.
gnuplot: can't allocate 'coral'. Using black.
Is there anyway to circumvent this problem? Also, the output .ps file still
stick to the old default color sequence, (i.e. "red","green","blue",...)no
matter how i modify .Xdefaults (the results from terminal x11 loo

【在 A*****o 的大作中提到】
: in your home directory .Xdefaults (if u don't have one, create one)
: append
: gnuplot*background: white
: gnuplot*textColor: black
: gnuplot*borderColor: black
: gnuplot*axisColor: black
: gnuplot*line1Color: red
: gnuplot*line2Color: green
: gnuplot*line3Color: yellow
: gnuplot*line4Color: magenta

avatar
A*o
5

this is due to you don't have these three colors: 'sienna, orange, coral'
in your system.
not sure about ps files, but i think you can use png or jpeg terminal and that
will have correct color

【在 l***a 的大作中提到】
: when giving a first plotting command in gnuplot after .Xdefaults is setup,
: gnuplot may give the following complain --
: gnuplot> plot sin(cos(x))
: gnuplot: can't allocate 'sienna'. Using black.
: gnuplot: can't allocate 'orange'. Using black.
: gnuplot: can't allocate 'coral'. Using black.
: Is there anyway to circumvent this problem? Also, the output .ps file still
: stick to the old default color sequence, (i.e. "red","green","blue",...)no
: matter how i modify .Xdefaults (the results from terminal x11 loo

avatar
D*g
6
run "rgb" to see if you have these colors defined.

【在 l***a 的大作中提到】
: when giving a first plotting command in gnuplot after .Xdefaults is setup,
: gnuplot may give the following complain --
: gnuplot> plot sin(cos(x))
: gnuplot: can't allocate 'sienna'. Using black.
: gnuplot: can't allocate 'orange'. Using black.
: gnuplot: can't allocate 'coral'. Using black.
: Is there anyway to circumvent this problem? Also, the output .ps file still
: stick to the old default color sequence, (i.e. "red","green","blue",...)no
: matter how i modify .Xdefaults (the results from terminal x11 loo

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。