The following was significantly updated on 30 May 2012 and again on Aug 2014:
idl and pgplot and many other postscript plotting routines have this annoying “feature” wherein, the output postscript file, when displayed with evince (“evince <filename> &”), goes into a window whose banner does NOT give its filename. This is confusing if one is looking at multiple files. We would prefer that the banner gives the name of the displayed file.
E.g., if the postscript file was produced with pgplot, the window banner says “PGPLOT postscript plot”, rather than giving the file name.
E.g., if the postscript file was produced with IDL, the window banner says “Graphics produced by IDL”, rather than giving the file name. (NOTE ADDED AUG 2014: YUPING HAS CREATED A SCRIPT INSIDE IDL TO GENERATE A FILENAME TAG ON PS FILES. SEE HIS POST!)
The reason is, that it writes into the file itself that the title is “PGPLOT postscript plot”; i.e., it literally writes “%%Title: PGPLOT postscript plot”
(or something similar for the IDL) into the postscript file.
After much effort, I have realized that evince will automatically display the desired filename rather than the above useless info, if only
one eliminates the whole “”%%Title” line. (My first solutions, rather than eliminating that line, wrote the filename in the “%%Title” line.)
Inside IDL itself, I think it is not possible either to alter or to eliminate the %%Title line as the postscript file is written because the drivers are proprietary. Therefore one must fix the postscript file afterwards. (The web shows how to run a unix script inside IDL that does so.)
Inside pgplot itself, one CAN fix the drivers so as to eliminate the offending %%Title line: Go to drivers/psdriv.f
———–
To fix up a postscript file after the fact:
Joel has written a script (whose original was made and embellished by Joe Swiggum), joelpslabel, which
1. writes a new file whose name is the same as the original postscript file except
–Its name has an added “label” before the dot in the original file name
–Its modification date is listed as being identical (at least to the minute) with the original file name (as in “ls -al”) so that you know when the original was created. (This was hard!!!!!!!!!!!!)
2. The script then runs evince on the new file, thereby putting on the screen something identical to the old file but with a banner that gives the old file name
———————
The new file with the new name having “label” in it stays on disk, and the original file is untouched, and they both have the same (claimed) date on them. I do this because an older version of this script, which actually overwrote the original, sometimes got confused and the original was destroyed, requiring an archival search of old backups. The downside is of course twice as much disk space but hey disk space is cheap and easy these days.
One can run joelpslabel on the original file as many times as one likes – each time overwriting the “new” file but assigning it the date of the orig file.
One can also run evince on the new file infinite times. The only downside there is that the banner will give the newfilename the 2nd-infinite time, rather than the old file name. (The newfilename = oldfilename + “label”)
Known problem: The script searches for the first “.” in the filename and places “label” before it, so if your filename has more than one dot before “ps”, the name will be very screwy. joel.weisberg.ps -> joellabel.weisberg.ps