Color repetition when using boxes in gnuplot

Jey

My data file has just two columns.The following MWE on those columns produces boxes with repeated colors. Is it possible to produce unique colors for each box?

reset
set term postscript eps size 5.5,4.5 enhanced color solid lw 2\
font "arial,28"
set key right
set xtics rotate -45 font ",20"
set style fill solid 1 border -1
plot 'rankdefcount.dat' using ($0):2:($0):xticlabels(1) \
                                          notitle w boxes lc variable 
quit

Here is the output I got:

Output

Jey

After few attempts and help from the SO experts, I came up with the following solutions; none of them perfect, though.

Solution 1: ( with a random repetition using rand and rgb calls)

reset
set term postscript eps size 5.5,4.5 enhanced color solid lw 2 font \
"arial,28"
set key right
rgb(r,g,b)=int(255*r)*65536+int(255*g)*256+int(255*b)
do for [i=1:31] {
   myrand=rand(int(rand(0)*i*100)+i*100)
   set style line i linecolor rgb rgb(rand(0),rand(0),rand(0))
}
set xtics rotate -45 font ",20"
set style fill solid 1 border -1
plot 'rankdefcount.dat' using ($0):2:($0):xticlabels(1) \
                                          notitle w boxes lc variable 
quit

Here is the corresponding output:

rgb output

With palette definition (solution 2):

reset
set term postscript eps size 5.5,4.5 enhanced color solid lw 2 font \
"arial,28"
set key right
set palette color model HSV
set palette defined (0 0 1 1,1 1 1 1)
set palette defined ( 0 0 1 0, 1 0 1 1, 6 0.8333 1 1, 7 0.8333 0 1)
set boxwidth 0.5
unset colorbox
set xtics rotate -45 font ",20"
set style fill solid 1 border -1
plot 'rankdefcount.dat' using ($0):2:($0):xticlabels(1) \
                                          notitle w boxes lc palette 
quit

This is the output:

pal-redstart

For another solution (solution 3), replace the definition above with the following lines:

set palette color model HSV
set pm3d explicit at b
set palette rgbformulae 3, 2, 2

This is what I got:

pal-yellow

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

GNUplot surface using a predefined color map

From Dev

plot every subsequence with a different color using gnuplot

From Dev

Avoid code repetition when using xsl:choose and xsl:when

From Dev

Illegal repetition exception when using String.replaceAll() method

From Dev

Using RGB input boxes to apply color through JS

From Dev

gnuplot histogram with boxes (smooth frequency)

From Dev

Gnuplot histogram with boxes different results

From Dev

Gnuplot histogram with boxes different results

From Dev

Reproduce gnuplot's with boxes in matplotlib

From Dev

Not the same font in gnuplot when using command line or gnuplot commands

From Dev

reduce datapoints when using logscale in gnuplot

From Dev

Gnuplot y-scale when using multiplot

From Dev

I don't have color on my .eps figure using gnuplot

From Dev

I don't have color on my .eps figure using gnuplot

From Dev

gnuplot - using line color as third variable does not generate the required output

From Dev

CSS: Div boxes aren't even when using 50%

From Dev

Make the boxes stay still when scrolling down using the scroll bar

From Dev

Gnuplot vertical gradient on boxes depending of a value?

From Dev

Fighting with gnuplot to get boxes plot working

From Dev

Gnuplot - change background color

From Dev

Customize color ranges in Gnuplot

From Dev

How can I avoid repetition of a function when using the same output twice in SQL?

From Dev

Permutations with repetition using recursion - JavaScript

From Dev

Permutations with repetition using recursion - JavaScript

From Dev

How to remove unknown slits when using filledcurve in Gnuplot (epslatex)?

From Dev

No install option displayed when installing gnuplot using brew

From Dev

Set color to grey for points below some cutoff when plotting with palette in Gnuplot

From Dev

Using loops to output boxes

From Dev

gnuplot - filled curve with palette color

Related Related

  1. 1

    GNUplot surface using a predefined color map

  2. 2

    plot every subsequence with a different color using gnuplot

  3. 3

    Avoid code repetition when using xsl:choose and xsl:when

  4. 4

    Illegal repetition exception when using String.replaceAll() method

  5. 5

    Using RGB input boxes to apply color through JS

  6. 6

    gnuplot histogram with boxes (smooth frequency)

  7. 7

    Gnuplot histogram with boxes different results

  8. 8

    Gnuplot histogram with boxes different results

  9. 9

    Reproduce gnuplot's with boxes in matplotlib

  10. 10

    Not the same font in gnuplot when using command line or gnuplot commands

  11. 11

    reduce datapoints when using logscale in gnuplot

  12. 12

    Gnuplot y-scale when using multiplot

  13. 13

    I don't have color on my .eps figure using gnuplot

  14. 14

    I don't have color on my .eps figure using gnuplot

  15. 15

    gnuplot - using line color as third variable does not generate the required output

  16. 16

    CSS: Div boxes aren't even when using 50%

  17. 17

    Make the boxes stay still when scrolling down using the scroll bar

  18. 18

    Gnuplot vertical gradient on boxes depending of a value?

  19. 19

    Fighting with gnuplot to get boxes plot working

  20. 20

    Gnuplot - change background color

  21. 21

    Customize color ranges in Gnuplot

  22. 22

    How can I avoid repetition of a function when using the same output twice in SQL?

  23. 23

    Permutations with repetition using recursion - JavaScript

  24. 24

    Permutations with repetition using recursion - JavaScript

  25. 25

    How to remove unknown slits when using filledcurve in Gnuplot (epslatex)?

  26. 26

    No install option displayed when installing gnuplot using brew

  27. 27

    Set color to grey for points below some cutoff when plotting with palette in Gnuplot

  28. 28

    Using loops to output boxes

  29. 29

    gnuplot - filled curve with palette color

HotTag

Archive