0

I am using gracebat of xmgrace to generate images of bar graphs (based on xvg inputs) in batch mode:

gracebat input.xvg -hdevice PNG -nosafe -printfile output.png -hardcopy -batch grace.bfile

and here is my batch file

s0 line type 0
s0 type BAR
s0 line color 4 # this does nothing
HARDCOPY DEVICE "PNG"
PAGE SIZE 800, 600
xaxis label char size 2.50000
yaxis label char size 2.50000
xaxis ticklabel char size 2.000000
yaxis ticklabel char size 2.000000

This is an example of the output image: enter image description here

It produces what I need with the exception of the color of the bars. What option of the batch file could be useful to set up blue background for the bars (presently it is white/transparent) as well as to increase the thickness of the black outline?

lr1985
  • 1,085
  • 1
  • 9
  • 21

1 Answers1

0

For some reason bars are treated as symbols by xmgrace, which means that what you want can be accomplished with the following lines:

s0 symbol linewidth 4
s0 symbol fill pattern 1
s0 symbol fill color 4

the first line makes the bars thicker, the last two change the colour of their background.

lr1985
  • 1,085
  • 1
  • 9
  • 21
  • right, thank you so much! one question - what the option to define colour of countour line ? Now all the bars are in blue (including countour line). The following options (which should normally be related to this setting) are also have been already activated: S0 SYMBOL COLOR 1 and S0 SYMBOL FILL 1 –  Oct 26 '20 at 16:51
  • The output I get with the script you posted + my lines is one with black contour lines. Make sure you don't have any `s0 symbol linestyle 0` line in there – lr1985 Oct 27 '20 at 08:00
  • OK, I found it: s0 line color 1 :-) If it is OK for you, please see my another recent question about grace batch. thank you ! –  Oct 27 '20 at 08:30