Wednesday, August 31, 2011

Gnuplot advanced background color (0)

It is not so hard to plot a single color background graph using gnuplot, and we have done this in blog ---- simple background color. But how about a linear gradient colored background?

The fill color of a object can not be set to be gradient in gnuplot. So the method in simple background color can not be copied, at least can not be copied directly. But if we draw a set
of small rectangles with different color, it may have the same appearence as a large rectangle with linear gradient color. Now let us realize this idea.
reset
n=200   #number of rectangles
dx=1.0/n    #legth of rectangle
set palette defined(0"white",n"#ccffcc")  #set gradient color
set cbrange [0:n]
unset colorbox
set for [i=1:n] object i rectangle from screen (i-1)*dx,0 to \
screen i*dx+dx/2,1 fs solid 1.0 noborder fillcolor palette cb i \
behind
#draw a set of rectangle with diffrent color."+dx/2" makes the
#adjacent rectangles have a common part, so that the border is not
#so obvious
set term png
set output "backgradient1.png"
plot sin(x) w l lw 0 lc palette cb 0 notitle,sin(x) w l lw 2 lc \
rgb"blue" notitle
#The first plot is just used to enable the palette, and it will be
#covered by the second plot never appearing on the output picture.
set output
And the above commands produce the following graph:

Linear gradient colored background

3 comments:

  1. I would like to 일본야동 thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.

    ReplyDelete
  2. Gnuplot Surprising: Gnuplot Advanced Background Color (0) >>>>> Download Now

    >>>>> Download Full

    Gnuplot Surprising: Gnuplot Advanced Background Color (0) >>>>> Download LINK

    >>>>> Download Now

    Gnuplot Surprising: Gnuplot Advanced Background Color (0) >>>>> Download Full

    >>>>> Download LINK yF

    ReplyDelete
  3. Great shar! Keep posting!
    عزل

    ReplyDelete

Creative Commons License
Except as otherwise noted, the content of this page is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.