This Appendix presents many frequently asked questions about WIP and WIP commands. These questions have come from users from their usage of WIP. Hopefully, this list will address most of the questions that novice users may encounter and present solutions to problems that others may find useful as they become more experienced and attempt more complicated plots. Each topic will first present the problem or question and then a solution will begin following the `' character. This list of questions should also be the most volatile of the entire manual as more users submit questions and solutions to various problems.
When I run my plot file on my screen, everything looks great. But when I send it to the printer, nothing shows up. Here are the commands I execute:
Whenever you send a plot to a printing device, you should terminate the plot by using either the hardcopy command or another call to the device command. These commands inform the plot that there is not going to be any further information coming and it should insert device specific closing commands. In the case of the printing device `/vps' shown above, the commands that are inserted instruct the printer to print and eject the page it has been generating. Without these inserted commands, the plot file is (internally) read by the printer and then ignored because it is never told to eject the page.
An alternative to the example above is to use the phard command. This command initiates a (temporarily) new, user specified device and then plays back all the commands issued and then performs the hardcopy command to close the plot file. The final operation of the phard command is to reinstate the device that was active when this command was called. To illustrate, the commands shown previously, can be replaced with the following:
Finally, this plot could also be sent by using the single command line:
I have a macro defined as follows:
The error message is not so much to do with the macro, per say, as to what it is going on in the macro. Every time the command hardcopy is called, the device that was used to do the drawing is closed. However, the next command to be executed is to enter the macro again and the first "graphical command" is to set the expansion size. WIP checks that the requested expand size matches the returned value from PGPLOT. If the two do not match, a warning message is sent (which is the message that was displayed). Now, PGPLOT interprets erase commands as a new page request. For printing devices, this is basically the same as the hardcopy command except that it does not close the device. Because the macro doloop above has the erase command at the top of it, a suggested alternative to the commands above would be (the macros may stay the same):
I often need an offset to move away from my current position. Is there (or can there be) a command like ``shift'' that moves the pointer relative to the previous move or draw end position?
A general offset command would be quite difficult to create due to the possible range and direction of world coordinates. If you want a macro that would do it for a particular orientation and scale (e.g. RA/dec plots), consider the following macro definition:
The move or draw commands could be folded into the doshift macro by adding another 3 arguments, as in:
I have been using WIP to make a macro for doing multi-panel plots with velocity labeling all automatically grabbed from the image header, or at least attempting to do so. I have made good progress but I am having trouble dealing with changing numbers into characters and having the various text writing command believe in text variables. For example if I calculate the velocity of a channel in a macro, how do I load that value into a text variable and get it printed to the screen without doing it one symbol at a time?
This is illustrated in section E.7.
I am trying to display an image with Right Ascension and Declination coordinates. When I use the command
What is happening is that the second argument to the box command is missing the y character. This character tells the time labeling routine not to break up the label at the 24 hour mark (i.e. do not do any day formatting). To correctly display declination, you must include both the y and the z character in the second argument to box. Another alternative is to include in the second argument the d option (and the h in the first argument) which will add unit superscripts. The d option implicitly implies the y option. For more details about these and other characters and what duties they perform, see Table 3.4.
I have loaded a FITS image, retrieved the header, and displayed and boxed the image in WIP as follows:
Some FITS image writers omit keywords. Make sure that the image header keywords required by WIP are present in the FITS image. In order to properly read header information and use it to display the coordinates with the box command, the optional header keywords should also be present. See the FITS image description in Section 5.1 for a list of required and requested keywords. Also see Section E.10 for a sample FITS header.
Is it possible to call various WIP routines from a Fortran program?
No. WIP is a collection of routines designed to act as a user interface to the PGPLOT graphics routines. Fortran programmers should call the individual PGPLOT routines directly.
I am using the panel command to display multiple images side by side. I want to have the individual boxes butt up against each other. However, every time I call panel with negative arguments (even after calling submargin 0 0), there is still a gap between the boxes.
This is dealt with in Section 5.3.
This problem concerns writing instructions to users inside the WIP command window. For example, a macro allows the user to select where in a frame to place a label using the cursor. But, if this macro is to be generally usable, it really should write to the command window a message telling the user what the macro is expecting at each cursor prompt. Can this be done simply in WIP?
This is quite easy to do with the echo command. The following simple macro shows how to prompt just before a cursor call.
When I chose vertical tick labels along the y-axis of the box, the y-axis text label overlaps them (especially if the numbers at a major tick interval is 3 or more digits).
Vertical labeling is a problem for large value coordinates (like declination). The default ylabel command is actually an alias for the mtext command. In fact, the following two commands are identical:
I want to plot error bars on a log plot. Is there a simple way to do this? I've tried using the logarithm err command but can't seem to get it to work. Any suggestions?
Logarithmic plots with error bars is a bit tricky because the values in the ERR array are offset values rather than the actual error values. To solve this, either modify the data outside of WIP or write a macro to do the math internally. Examples of both are shown below. In both examples, it is assumed that the X, Y, and ERR data in data.lis are found in columns 1, 2, and 3, respectively. For UNIX users, the awk command:
I have tried to plot the spatial distribution of stars (i.e. dots on Right Ascension -- Declination plot) but I can't get the aspect ratio of the map right. The star positions are read in from a text file. I know that winadj works for images but when I use it for a simple plot with individual points, it didn't seem to understand that the Right Ascension unit is 15 times smaller than the Declination unit. Am I missing something?
In order to get the spatial distribution correct, you will have to help WIP out. You are correct that WIP doesn't know that Right Ascension is about 15 times smaller than the Declination axis. This is because the world coordinate system has no units associated with it. The best solution is use winadj with the spatial extent arguments provided in the same units. For example, if your plot runs in Right Ascension from to and Declination from to , you might use the following:
Suppose I have two WIP plotting command files and do the following:
What you are actually getting out in the second PostScript file is the combination of both input commands. This is because the input command stays on the playback stack and the phard command plays back all commands on the stack. Hence, the second phard command will call input first.wip followed by input second.wip.
I wish to do something quite simple: have a number like 1.234 (which is generated within a WIP macro) be part of a plot label. Is this possible? If so, there a way to control the number of significant figures for this purpose?
The answer to both questions is yes. Any label with the construct \[x] will actually be plotted as if the current value of the user variable x was used in the command. See Section 3.6 and Table 3.5 for more details on how to insert user variables in a text command.
To control the number of significant digits, change the value of the user variable nsig. By default, it is set to 3; specifying a larger value will cause more digits to be displayed.
Is it possible to break out of a loop command early (i.e. before the total number of iterations are reached) based on some condition within that macro?
The only way to do this is (not very elegant) to add a conditional to the macro and have the macro exit when the condition is met. This will still mean the macro is called the requested number of times, but each time it is called with the counter greater than the conditional value, it will just exit. A trivial example follows that will only print out the first ten numbers even though the loop is being executed twenty times: