[Wien] Not able to plot 2 adjacent (parallel) band gap plots in xmgrace.
Gavin Abo
gsabo at crimson.ua.edu
Thu Sep 6 23:41:31 CEST 2012
The following should help you with your problem. I assume you have
generated two agr files with Wien2k, such as "case.bands.agr" and
"case1.bands.agr".
Both these files have a graph set of g0 specified throughout the inside
of the files, so the data in both files are combined in the g0 data
set. So you need to change the graph set in one of the files to g1.
You can use the simple perl script below to help you do just that. In
the directory with "case1.bands.agr" and "renamegset.pl", run in a terminal:
renamegset case1.bands.agr 1 >> caseg1.bands.agr
(notice the output file has a "g" in it so that is doesn't overwrite the
original file)
renamegset.pl
----------------------------------
#!/usr/bin/perl
#
# Renames Grace graph set numbers
#
# usage: renamegset file.agr graphnumber
#
# graphnumber is an integer 1,2,...
#
# output to stdout
#
# To redirect stdout to a file:
# renamegset file.agr graphnumber >> outfile.agr
#Opens file.agr
open FILE, "<$ARGV[0]";
#Searches file.agr
while (<FILE>) {
#Regular expression
#For example, replaces g0 with g1
#In general, replaces 0 with the given "graphnumber"
s/([gG])([0-9]+)/g$ARGV[1]/g;
#Prints new file.agr to the screen
print $_;
}
#Closes file.agr
close FILE;
----------------------------------
After creating "caseg1.bands.agr" with the g1 data set, the file should
be in the same directory as "case.bands.agr" and the batch file
"case.bfile". Then, the two graphs can be plotted together vertically
(above/below each other) by using in the terminal:
xmgrace -batch case.bfile
You can also modify the "case.bfile" if you want the graphs horizontally
(side by side) instead. The same procedure can be extended to plot more
than two graphs as well.
case.bfile
----------------------------------
# Usage: xmgrace -batch case.bfile
# Must run in directory with case.bands.agr and caseg1.bands.agr
# Tested with Grace-5.1.22
# Creates a panel of graphs (Example here for 2 rows and 1 column)
arrange(2,1,0.01,0.5,0.5)
# Selects panel graph 0
FOCUS G0
# Reads agr file for graph 0
READ "case.bands.agr"
# Sets the size and placement of graph 0
VIEW 0.2,0.8,0.8,1.2
# Selects panel graph 1
FOCUS G1
# Reads agr file for graph 1
READ "caseg1.bands.agr"
# Sets the size and placement of graph 1
VIEW 0.2,0.1,0.8,0.5
----------------------------------
On 9/6/2012 10:11 AM, Masood Yousaf wrote:
> Respected Wien2k Users
>
> This is my second email although the problem looks simple. I tried to
> make 2 band gap plots adjacent (parallel) to each other in xmgrace but
> when I try to insert the second band gap plot in xmgrace in seperate
> graph(adjacent to 1st plot), it does not appear. I tried several time
> with different approaches but was not able to produce two band gap
> plots adjacent to each other . Kindly guide how can I over come this
> problem.
>
> Best wishes
> Masood
>
>
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20120906/d06870c1/attachment.htm>
More information about the Wien
mailing list