|
From: Ethan M. <merritt@u.washington.edu> - 2006-12-14 00:49:31
|
On Wednesday 13 December 2006 03:46 pm, Mojca Miklavec wrote: > > this is not problematic for "clever users", but it might sometimes > lead to unexpected results. > > Suppose that the user says: > > set output "something.ps" > set term post (or some other terminal) > plot sin(x) > plot cos(x) > set term post color > plot erf(x) > > png & friends simply overwrite the existing image file, but > PostScript driver writes out a file that could probably be considered > "broken". I take your point, although in this particular example I am not sure what the user intended to happen. You don't need to change the terminal properties in order to specify a colored line as opposed to a black line. Nevertheless, we have discussed the general issue before. The outcome at that time was to create a new command, "set termoption", that allows you to change some property of the current terminal without closing and re-opening it. So if you want to change the default font, for example, you can say set termoption font "Newfont,newsize" That has the double advantage of not closing and re-opening the terminal, and being compatible with all terminals rather than being specific to the one particular terminal you are currently using. Better for scripting. That said, not a whole lot of attention has been paid to extending the number of terminal properties that can be changed using this command. If you think being able to toggle the default line colors between color and mono would be useful, feel free to code up a patch that adds those two properties to the list of options accepted by 'set termoption'. In the case of PostScript, you could have it insert the command: /Color true def into the output stream Be aware, however, that this will make it so that individual plots within a postscript file containing multiple pages will now be sensitive to the order of viewing. That is, if you call up the file in ghostview and step through the plots backwards, or in random order, they will inherit the properties of the previous plot viewed rather than the previous plot in order of creation. -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle WA |