[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    Re: "set term" between plots
From:       "Mojca Miklavec" <mojca.miklavec.lists () gmail ! com>
Date:       2006-12-14 1:31:29
Message-ID: 6faad9f00612131731y64da7d3fn4a500c34865c4a7d () mail ! gmail ! com
[Download RAW message or body]

On 12/14/06, Ethan Merritt wrote:
> 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.

That was just a "stupid example".

> 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.

Some changes might make sense between plots and some do not, but that
highly depends on the terminal used and there must be a good reason to
implement any specific feature such as "enable change of plot size"
since almost all the terminals have to be changed in that case. My
point was not "gnuplot needs a new feature", but rather "gnuplot might
produce broken files" without any warning and that should be fixed.

I tried the pdf terminal now and it ignores anything written before
"set term pdf", so the example

set output "something.pdf"
set term pdf
plot erf(x)
set term pdf enhanced (just as an example)
plot cos(x)
plot sin(x)

would result in two pages with sin and cos, while PostScript and
TeX-based terminals would include all the three plots in a
kind-of-broken format. Wouldn't it be more consistent if the file
would be deleted/opened again for writing after "set term"?
(functionally better alternative would be to implement a new function
inside each terminal to parse & handle additional settings, but I'm
not capable of implementing that for all the terminals)

Or is there some better way to reopen a file inside term->init and
start writing a new file from scratch?

Thanks,
     Mojca

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic