Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #3977 > unrolled thread
| Started by | palme@kapott.org |
|---|---|
| First post | 2018-06-27 12:01 -0700 |
| Last post | 2018-06-29 21:04 +0000 |
| Articles | 13 — 4 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
How to reset configurations to their defaults? palme@kapott.org - 2018-06-27 12:01 -0700
Re: How to reset configurations to their defaults? Ethan Merritt <eamerritt@gmail.com> - 2018-06-28 04:36 +0000
Re: How to reset configurations to their defaults? palme@kapott.org - 2018-06-27 22:07 -0700
Re: How to reset configurations to their defaults? palme@kapott.org - 2018-06-27 22:26 -0700
Re: How to reset configurations to their defaults? palme@kapott.org - 2018-06-27 23:01 -0700
Re: How to reset configurations to their defaults? Ethan Merritt <sfeam@users.sf.net> - 2018-06-28 19:32 +0000
Re: How to reset configurations to their defaults? palme@kapott.org - 2018-06-28 13:14 -0700
Re: How to reset configurations to their defaults? palme@kapott.org - 2018-06-28 13:22 -0700
Re: How to reset configurations to their defaults? Karl Ratzsch <mail.kfr@gmx.net> - 2018-06-29 01:57 +0200
Re: How to reset configurations to their defaults? palme@kapott.org - 2018-06-28 21:32 -0700
Re: How to reset configurations to their defaults? Ethan Merritt <eamerritt@gmail.com> - 2018-06-29 05:37 +0000
Re: How to reset configurations to their defaults? palme@kapott.org - 2018-06-29 00:27 -0700
Re: How to reset configurations to their defaults? Ethan Merritt <eamerritt@gmail.com> - 2018-06-29 21:04 +0000
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-27 12:01 -0700 |
| Subject | How to reset configurations to their defaults? |
| Message-ID | <cd0f19dc-36b6-4636-9101-1bd02a47062b@googlegroups.com> |
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. 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. 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-
[toc] | [next] | [standalone]
| From | Ethan Merritt <eamerritt@gmail.com> |
|---|---|
| Date | 2018-06-28 04:36 +0000 |
| Message-ID | <ph1okb$7m0$2@dont-email.me> |
| In reply to | #3977 |
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-
[toc] | [prev] | [next] | [standalone]
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-27 22:07 -0700 |
| Message-ID | <2e3258e6-1bce-465f-9817-049a03ae996f@googlegroups.com> |
| In reply to | #3977 |
Thanks, this was very helpful for understanding. What about "set grid front"? This is not reset to the "default layer" with "unset grid; set grid". Is there also another setting which is only aliased by "set grid front/back"? Thanks -stefan-
[toc] | [prev] | [next] | [standalone]
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-27 22:26 -0700 |
| Message-ID | <a9a16ff6-a11f-4f9f-90c2-554d192b8951@googlegroups.com> |
| In reply to | #3980 |
> What about "set grid front"? This is not reset to the "default layer" with "unset grid; set grid". Is there also another setting which is only aliased by "set grid front/back"? Similar issue for set title foobar noenhanced. The "noenhanced" flag is not reset with "unset title" (while all other title properties are reset to their defaults). -stefan-
[toc] | [prev] | [next] | [standalone]
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-27 23:01 -0700 |
| Message-ID | <21868ab2-d7c2-472d-9b53-60f40311fd31@googlegroups.com> |
| In reply to | #3981 |
> > What about "set grid front"? This is not reset to the "default layer" with "unset grid; set grid". Is there also another setting which is only aliased by "set grid front/back"? Similar issue with "set grid linetype 5". The command sequence "unset grid; set grid" does not restore the grid linetype to its default value. While working with all those settings, I find more and more such examples. Do I miss some basic understanding? Or are these things indeed bugs that I should report? -stefan-
[toc] | [prev] | [next] | [standalone]
| From | Ethan Merritt <sfeam@users.sf.net> |
|---|---|
| Date | 2018-06-28 19:32 +0000 |
| Message-ID | <ph3d4f$l9$1@dont-email.me> |
| In reply to | #3982 |
On Wed, 27 Jun 2018 23:01:46 -0700, palme wrote: >> > What about "set grid front"? This is not reset to the "default layer" >> > with "unset grid; set grid". Is there also another setting which is >> > only aliased by "set grid front/back"? > > Similar issue with "set grid linetype 5". > > The command sequence "unset grid; set grid" does not restore the grid > linetype to its default value. > > While working with all those settings, I find more and more such > examples. Do I miss some basic understanding? Or are these things indeed > bugs that I should report? Not bugs. Consider that you can toggle the grid on/off interactively. This would be useless if all the current grid settings were lost every time you toggled it off. "set/unset grid" with no extra keywords should be considered as "display or don't display the current grid". Similar argument for tics. The assumption is that while the user probably will not want the same specific tic placements on successive plots, they probably will want the same font/linewidth/ticscale/etc formatting. In your case this assumption is apparently wrong. You confuse me a bit by saying that you > 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. That seems very close to what the program assumes: no change to what the tics "look like", only where they are placed. In the environment you describe, perhaps one solution is to create a set of short scripts each of which fully describes the tic properties. Then your overall script would refer to the desired style each time: set multiplot load 'tic_style_A.gp' plot ... load 'tic_style_B.gp' plot ... load 'tic_style_C.gp' plot ... unset multiplot Ethan > > -stefan-
[toc] | [prev] | [next] | [standalone]
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-28 13:14 -0700 |
| Message-ID | <9d2ffdb9-bad7-43f9-b3d6-613fa7f06a61@googlegroups.com> |
| In reply to | #3983 |
Hi Ethan, thanks for the detailed explanations. > Not bugs. > ... I understand this perspective, and I agree. Maybe my use case is just a bit weird: Assume I would collect gnuplot scripts from arbitrary users. Each user provides one or more separate gnuplot scripts, each script creates exactly one plot/graph. When creating these scripts the users assume that they start from a fresh gnuplot session with all values set to their defaults. Now I want to place several of these user-provided plots in a multiplot (the order is determined dynamically at runtime, i.e. it cannot be predicted). For this I would either have to insert a "reset" before each user script (to consider the fact that each script assumes it runs in a default environment), or I would have to insert commands to put all settings to their defaults explicitly. The "reset" approach does not work because it also destroys the multiplot environment, and the problems with the "explicit set values to defaults" approach are described in my previous post. Also following your suggestion to use "set" commands that specify all possible options explicitly is problematic, because then I would have to parse the user provided scripts, understand all the set commands, find the values that were not explicitly given, and add the corresponding default values to the set commands. I think you get the point why I don't like this approach :) (This description is not at all the real use case, but it describes the fundamental problem quite accurately). I understand that my "problems" are actually not caused by bugs, just by a philosophy which does not fit my use case. Currently I see two ways for me: 1) Execute each user script separately in a really clean environment (i.e. with a "reset" or whatever before them), and then find a non-gnuplot based way to put all of them onto a single page (i.e. emulating "multiplot" by myself). 2) The gnuplot community agrees that there might be different kinds of "reset" commands: one that also affects a multiplot context, another one that resets everything EXCEPT the multiplot information, ... ideas welcome Sorry for the lengthy post... One last comment: your description of unset/set to hide/show a certain feature makes sense from user perspective. But in this case the documentation should be updates, because it describes the "unset" command like this: > Options set using the set command may be returned to their default state by the corresponding unset command. Obviously this is not true :-) Thanks and regards -stefan-
[toc] | [prev] | [next] | [standalone]
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-28 13:22 -0700 |
| Message-ID | <e6f4c672-8803-4353-87f3-fc578d4de14b@googlegroups.com> |
| In reply to | #3984 |
> 1) Execute each user script separately in a really clean environment (i.e. with a "reset" or whatever before them), and then find a non-gnuplot based way to put all of them onto a single page (i.e. emulating "multiplot" by myself). > > 2) The gnuplot community agrees that there might be different kinds of "reset" commands: one that also affects a multiplot context, another one that resets everything EXCEPT the multiplot information, ... ideas welcome 3) Each set command could support "set ... default" to reset all parameters to their default values (as it already exists with "set key default")
[toc] | [prev] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2018-06-29 01:57 +0200 |
| Message-ID | <ph3sl9$kgk$1@solani.org> |
| In reply to | #3985 |
Am 28.06.2018 um 22:22 schrieb palme@kapott.org: >> 1) Execute each user script separately in a really clean environment (i.e. with a "reset" or whatever before them), and then find a non-gnuplot based way to put all of them onto a single page (i.e. emulating "multiplot" by myself). >> >> 2) The gnuplot community agrees that there might be different kinds of "reset" commands: one that also affects a multiplot context, another one that resets everything EXCEPT the multiplot information, ... ideas welcome > > 3) Each set command could support "set ... default" to reset all parameters to their default values (as it already exists with "set key default") > "reset" does not "destroy" the multiplot environment, it's just not compatible with multiplot's "layout" option. That specific aspect could easily get fixed, i think.
[toc] | [prev] | [next] | [standalone]
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-28 21:32 -0700 |
| Message-ID | <2f0dac43-08ed-4934-9505-7c0f167b909c@googlegroups.com> |
| In reply to | #3986 |
On Friday, 29 June 2018 01:57:30 UTC+2, Karl Ratzsch wrote: > > "reset" does not "destroy" the multiplot environment, it's just not > compatible with multiplot's "layout" option. > Indeed. When using "set multiplot" in combination with "set size" and "set origin" for each plot explicitly, I can prefix each plot with "reset", and the result is what I expect. This would require me to do some simple maths for the correct values for the size/origin parameters, depending on the number of rows/columns, but this is a walk in the park compared to all the other ugly solutions ;-) set multiplot reset set size 0.5,0.5; set origin 0,0 plot sin(x) reset set size 0.5,0.5; set origin 0.5,0 plot cos(x) reset set size 0.5,0.5; set origin 0,0.5 plot tan(x) reset set size 0.5,0.5; set origin 0.5,0.5 plot x*x unset multiplot Thanks a lot to both of you, this was really helpful to improve my understanding and to solve my issue -stefan-
[toc] | [prev] | [next] | [standalone]
| From | Ethan Merritt <eamerritt@gmail.com> |
|---|---|
| Date | 2018-06-29 05:37 +0000 |
| Message-ID | <ph4giv$ko3$1@dont-email.me> |
| In reply to | #3986 |
On Fri, 29 Jun 2018 01:57:26 +0200, Karl Ratzsch wrote: > Am 28.06.2018 um 22:22 schrieb palme@kapott.org: >>> 1) Execute each user script separately in a really clean environment >>> (i.e. with a "reset" or whatever before them), and then find a >>> non-gnuplot based way to put all of them onto a single page (i.e. >>> emulating "multiplot" by myself). >>> >>> 2) The gnuplot community agrees that there might be different kinds >>> of "reset" commands: one that also affects a multiplot context, >>> another one that resets everything EXCEPT the multiplot information, >>> ... ideas welcome >> >> 3) Each set command could support "set ... default" to reset all >> parameters to their default values (as it already exists with "set key >> default") >> >> > "reset" does not "destroy" the multiplot environment, it's just not > compatible with multiplot's "layout" option. > > That specific aspect could easily get fixed, i think. I agree. In fact the bug is strangely specific to the plot immediately following the reset. After that it recovers its position in the multiplot layout. So with that in mind, here is a work-around to use right now. Requires gnuplot version 5.0 or 5.2 set multiplot layout 2,2 plot 1 reset; set multiplot next; set multiplot previous plot 2 reset; set multiplot next; set multiplot previous plot 3 reset; set multiplot next; set multiplot previous plot 4 unset multiplot
[toc] | [prev] | [next] | [standalone]
| From | palme@kapott.org |
|---|---|
| Date | 2018-06-29 00:27 -0700 |
| Message-ID | <bcf67f4c-e67a-4348-931a-680c7800c482@googlegroups.com> |
| In reply to | #3988 |
> set multiplot layout 2,2 > plot 1 > reset; set multiplot next; set multiplot previous > plot 2 > reset; set multiplot next; set multiplot previous > plot 3 > reset; set multiplot next; set multiplot previous > plot 4 > unset multiplot Works for me, thanks!
[toc] | [prev] | [next] | [standalone]
| From | Ethan Merritt <eamerritt@gmail.com> |
|---|---|
| Date | 2018-06-29 21:04 +0000 |
| Message-ID | <ph66st$alc$1@dont-email.me> |
| In reply to | #3986 |
On Fri, 29 Jun 2018 01:57:26 +0200, Karl Ratzsch wrote: > Am 28.06.2018 um 22:22 schrieb palme@kapott.org: >>> 1) Execute each user script separately in a really clean environment >>> (i.e. with a "reset" or whatever before them), and then find a >>> non-gnuplot based way to put all of them onto a single page (i.e. >>> emulating "multiplot" by myself). >>> >>> 2) The gnuplot community agrees that there might be different kinds >>> of "reset" commands: one that also affects a multiplot context, >>> another one that resets everything EXCEPT the multiplot information, >>> ... ideas welcome >> >> 3) Each set command could support "set ... default" to reset all >> parameters to their default values (as it already exists with "set key >> default") >> >> > "reset" does not "destroy" the multiplot environment, it's just not > compatible with multiplot's "layout" option. > > That specific aspect could easily get fixed, i think. Fixed not in upstream source for 5.2 and 5.3 Ethan
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web