1

I have the simple 2D graphs in the following format:

@    title  "No tittle"
@    xaxis  label "Water Index"
@    yaxis  label "Occupancy"
@TYPE xy
22710    1147   
24183    3  
25029    1198   
30513    671    
33768    1  
44475    69 
45612    235    
46023    57 
47028    34 
49080    839    
5079     681    
5082     597    
5085     385    
5088     1149   
5091     1179   
5097     505    
51315    1  

While printing that staff via XMGRACE I obtain a curved image (see the picture) instead of good-looking 2D Bar plots that is easy to obtain via excel. enter image description here

Is it possible to modify the format of the file in order to improve its visualization quality (e.g. making a bar or pie plots for such kind of data) for the XMGRACE?

EDIT: the batch file with the following options is provided for each XVG file in order to print it as png

 READ NXY "here is the path to XVG"
s0 line color 4
PRINT TO "where to save png"
HARDCOPY DEVICE \"PNG\"
PAGE SIZE 450, 300
DEVICE \"PNG\" FONT ANTIALIASING on
DEVICE \"PNG\" OP \"compression:9\"
#DEVICE \"PNG\" OP \"transparent:on\"
xaxis label char size 2.50000
yaxis label char size 2.50000
xaxis ticklabel char size 2.500000
yaxis ticklabel char size 2.500000
PRINT

Thanks in advance!

Gleb

  • I noticed you tend to upvote answers rather than mark them as accepted. If you think one of the answers fully address your issue it would be better to mark it as accepted by clicking the green check mark. This helps to more easily find questions that still don't have answers. – lr1985 Apr 19 '18 at 11:54

1 Answers1

1

I am not exactly sure what you are asking, but the following minimalistic example will give you bars:

@    title  "No tittle"
@    xaxis  label "Water Index"
@    yaxis  label "Occupancy"
@s0 line type 0
@TYPE bar
22710    1147   
24183    3  
25029    1198   
30513    671    
33768    1  
44475    69 
45612    235    
46023    57 
47028    34 
49080    839    
5079     681    
5082     597    
5085     385    
5088     1149   
5091     1179   
5097     505    
51315    1  

enter image description here

If you want to achieve the same result using the graphical interface, just double click on the plot, select the dataset you want to change (G0.S0 in this case) and set Type to BAR in the Set presentation box and Type to None in the Line properties box

lr1985
  • 1,085
  • 1
  • 9
  • 21
  • thanks!! generally it looks fine! the only question is on the plotting the graphs as a png. I do it via gracebat providing a batch file with the content shown in my first post (updated). Briefly after adding @ s0 line type 0 to the xvg file I obtain an empty png at the end. How it could be fixed (I guess something within batch file should be modified for bar graphs as well!) thanks! –  Apr 19 '18 at 11:58
  • Just add `s0 type BAR` to your batch file. – lr1985 Apr 20 '18 at 10:03