Plotting In Ifeffit
Contents
How can I get PGPLOT working on Unix?
- Here are my suggestions: First, if you're using linux, use the PGPLOT_install script:
PGPLOT_install
- If this doesn't work, or if you think there might already be a version of PGPLOT on your computer, find them and delete them: Look for the files:
/usr/local/lib/lib*pgplot.* /usr/local/pgplot
- and delete them. Really, delete them. Please do not ask for help using a pre-packaged binary or package. Once PGPLOT is completely removed, run PGPLOT_install from the IFEFFIT distribution. This expects to be run with root access. If you do not have root access to your machine, use the '--prefix' option:
PGPLOT_install --prefix=/home/bob/lib
which will create a directory /home/bob/lib/pgplot for all the PGPLOT stuff.
Then, RUN THE PGPLOT DEMOS!!! If the demos don't work, IFEFFIT won't work. If you ask for help, you will volunteer information about whether the demos work. If you ask for help with PGPLOT and do not volunteer information about whether the demos run, you will be sent to this FAQ! Finally, once the PGPLOT demos work, configure IFEFFIT to explicitly use the PGPLOT library you just made:
./configure --with-pgplot=/home/bob/lib/pgplot make
How can I get a hardcopy of a plot?
There are a few different options.
First, you can translate any plot currently on the screen to a Postscript file by issuing
ifeffit> plot(device='/cps', file='my_graph.ps')
Here, '/cps' means color postscript. You can use any filename you want (the default is ifeffit.ps).
To get a GIF or PNG file (GIF on Win32, PNG on Unix and Mac), you'd type
ifeffit> plot(device='/gif', file='my_graph.gif') ifeffit> plot(device='/png', file='my_graph.png')
(If you don't know what a PNG file is, they're like GIF only better. They can be used on web pages, in Microsoft Office, and in pdflatex).
For the GUIs Athena and Artemis, these commands for saving Postscript, GIF, or PNG images can done through pull-down menus.
These hardcopies are (in my opinion) pretty ugly. It may actually be worthwhile to 'capture the screen'. This is often overlooked, but can actually give decent results. On Windows, this is very easy to do: select 'Edit->Copy' from the Graphics Window, and then Paste into Microsoft PowerPoint, Wordpad, or whatever.
On linux, you might consider using an 'X window dumper' program, or a screen capture program. xwd is the classic X window dumper. For KDE, the ksnapshot works well. For Gnome, the screenshooter applet works well.
Why does Ifeffit/Athena/Artemis crash when I close the plot window?
On Windows, DO NOT CLOSE THE PLOT WINDOW!!!
Ifeffit WILL crash the next time you try to plot. I wish I knew how to fix this, but I don't. Sorry.
How can I get greek letters, special characters, subscripts, etc ?
The PGPLOT syntax for greek letters and other characters (say, the Angstrom symbol), and for getting subscripts, superscripts, and so on is a bit awkward, but fairly straightforward. Basically, there are 'special character escape sequences'. So
- \g means 'use Greek characters'
- \u means 'move up (superscript)'
- \d means 'move down (subscript)'
- \fn N means 'use Font N'
- N = 1 (Sans Serif), 2 (Roman), 3 (Italic), 4 (Script)
Here are some more examples:
plot(text = "Greek letters: \ga \gb \gc \gd \ge \gf \gh \gi \gj \gk \gm \gn", text_x= 9400, text_y = 3.3) plot(text = "Greek letters: \go \gp \gq \gr \gs \gt \gu \gv \gw \gx \gy \gz", text_x= 9400, text_y = 3.1) plot(text = "Common XAFS Symbols", text_x= 9400, text_y = 2.8) # |chi(R)| (Ang^(-3)) plot(text = "|\gx(R)| (\A\u-3\d)", text_x= 9900, text_y = 2.4) # k^2*chi(k) (Ang^(-2)) plot(text = "k\u2\d\gx(k) (\A\u-2\d)", text_x=10900, text_y = 2.4) # mu(E) plot(text = "\gm(E)", text_x= 9900, text_y = 1.8) # sigma^2 plot(text = "\gs\u2\d (\A\u2\d)", text_x=10900, text_y = 1.8) # change fonts: plot(text='\fn 1 \fn The Sans Serif Font', text_x=0.1, text_y=1.8) plot(text='\fn 2 \fr The Roman Font', text_x=0.1, text_y=1.6) plot(text='\fn 3 \fi The Italic Font', text_x=1.1, text_y=1.8) plot(text='\fn 4 \fs The Script Font', text_x=1.1, text_y=1.6)
More details are in the Reference Manual:
How do I add a new FAQ entry?
Edit this section, use copy and paste! Use a format like this, using the same level of header (i.e. the same number of = signs) and keeping the link back to the contents at the top of the page:
== How do I add a new FAQ entry? == Edit this section, use copy and paste! [#contents Contents] ----