Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ethan Merritt Newsgroups: comp.graphics.apps.gnuplot Subject: Re: How to reset configurations to their defaults? Date: Thu, 28 Jun 2018 04:36:28 -0000 (UTC) Organization: A noiseless patient Spider Lines: 73 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 28 Jun 2018 04:36:28 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="50bc121d94aea10bc4cf575adc93412d"; logging-data="7872"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RBOCHeDHrJtxzuJQX2kEL" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:RXmB8csNM8P4nugD4ErqIPtOajo= Xref: csiph.com comp.graphics.apps.gnuplot:3979 On Wed, 27 Jun 2018 12:01:34 -0700, palme wrote: > Hi all, > > I have something like the following: > > set multiplot layout 2,2 # first graph set xlabel "foo" font "serif,10" > set xtics format "%0.2f" > plot ... > # second graph set xlabel "bar" > set xtics 0,1,10 plot ... > # etc. etc. > unset multiplot > > The problem with this approach is that for example, the second "set > xlabel" uses the same font setting as the first one, although I want to > use the DEFAULT font instead. unset xtics; set xtics will restore the default font and most other properties. > Similarily, the second "set xtics" command uses the same format string > as the first one, although I want the second one to use the DEFAULT > format string. set format pr set format x will restore the default format. [FYI: "set xtics format foo" was a recently added alias for "set format x foo", which is why neither "set xtics" or "unset xtics" clears it. That was maybe an oversight.] Ethan > Currently I see the following (ugly) solutions for this: > > - For all settings always specify all parameters explicitly, i.e. in the > example above, add an explicit 'font whatever-the-default-is' respective > 'format "whatever-the-defaultis"' to the set commands. You already see > that this would require me to know all default values, and it would make > the commands stupidly long > > - For some settings there is a way to reset them to their default values > (e.g. "unset samples" or "set key default"), so that I thought about > using the unset command just before the set command, to always start > over from the default values. However, this does not work for all > settings, e.g. "unset xtics; set xtics" does NOT return all values to > their defaults (see https://sourceforge.net/p/gnuplot/bugs/2061/ ). > Similar issue with "set grid" and other settings, for which I did not > find a way to reset them to their default values. So this is also not a > generic solution. > > - Using "reset" just before calling all the "set" commands would work in > general - except in this case where I am in a multiplot context, because > the "reset" command will also destroy my multiplot context. > > Maybe it's worth mentioning that I am working on a tool which creates > gnuplot command files on the fly, based on some database content, user > input, stuff like that. So I cannot "fine tune" the resulting gnuplot > files by hand, but need a generic way to ensure that each plot (in a > multiplot environment) looks exactly as given in the configuration, and > does not "inherit" configuration settings from the previous plot. > > Any hints/tips/tricks for how to solve this? > > Thanks and regards -stefan-