|
From: | Daniel J Sebald |
Subject: | Re: Candidate stem-and-leaf plot function |
Date: | Tue, 29 Jan 2013 03:43:22 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
On 01/28/2013 11:52 PM, Michael D. Godfrey wrote:
On 01/26/2013 06:33 PM, Daniel J Sebald wrote:I think it is a good start to use Enscript. However, I'd suggest rather than "show_plot()", simply incorporate that code into the "stemleaf" function with option "enscript". Some options would be: "enscript" "text" "pdf" "trim" "ps" "trim" "eps" "trim"The attached function shows how to do much of this. The function can pretty trivially be modified to be inside stemleaf() and get executed depending on additional arguments to stemleaf(). I did not do the trim part, but I seem to remember that there is a simple way to do that, at least in some cases. So, is this pretty much like what you wanted?
Yes, that is the right idea. The command for creating EPS is ps2eps. I've tried it, but unfortunately it isn't very good at computing the proper bounding box. The top line and a half of text is cut off in this case. I will think about this and try to remember any other similar utility I've used. (I know dvips has an -E option, but of course that's of no use here.)
There is a problem with choosing a specific intermediate file name: it could clobber an existing file. For example, say the user types
show_plot (rx, 'test12', 'ps'); show_plot (rx, 'test12', 'pdf');Because "test12.ps" is the intermediate file in the second command, the test12.ps is deleted when the user really intended for it to be present. Try using temporary files/names with the tmpnam() function for the intermediate files.
Dan
[Prev in Thread] | Current Thread | [Next in Thread] |