Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

gnuplot: customize labels on bar plots

The following script make a bar graphs indicating the y values directly on the colored bars.

set term pngcairo size 1200,900
set title "$file_name" noenhanced font "Century,28" textcolor "#b8860b"
set xtics noenhanced font "Helvetica,10"
set xlabel "Residue, #"
set ylabel "dG, kKal/mol"
set yrange [-10:0]
set ytics 1.0
set grid y
set key off
set boxwidth 0.9
set style fill solid 0.5
plot \$data using 0:2:3:xtic(1) with boxes lc rgb var, \
        '' using 0:2:2 with labels offset 0,1

how could I additionally modify the text size and its color of the values corresponded to the Y-values in each bar ?
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Have you consulted help labels?

For example something like this:

set samples 11
plot '+' u 1:1 w boxes, '+' u 1:1:1 w labels tc "red" font ",14"

Not much different in your example:

plot \$data using 0:2:3:xtic(1) with boxes lc rgb var, \
        '' using 0:2:2 with labels tc "red" font "Arial Bold,14" offset 0,1  
  # or whatever font you have available
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading