|
From: michele c. <mi...@uk...> - 2006-02-24 13:01:09
|
hi there I wrote my own ~/.Xdefaults since I have to plot sth like 20 graphs. My intention was to keep the same line style while changing colours for the first 10 graphs... then to keep another line style & changing colours for the next 10 graphs... and so on You can find here below my .Xdefault file. Please let me know where I did wrong. thank you in advance cheers mic ---------------------------------- gnuplot*background: white gnuplot*textColor: black gnuplot*borderColor: black gnuplot*axisColor: black gnuplot*line1Color: blue gnuplot*line2Color: red gnuplot*line3Color: green gnuplot*line4Color: magenta gnuplot*line5Color: cyan gnuplot*line6Color: sienna gnuplot*line7Color: black gnuplot*line8Color: orange gnuplot*line9Color: coral gnuplot*line10Color: black, 0.5 gnuplot*line11Color: blue gnuplot*line12Color: red gnuplot*line13Color: green gnuplot*line14Color: magenta gnuplot*line15Color: cyan gnuplot*line16Color: sienna gnuplot*line17Color: black gnuplot*line18Color: orange gnuplot*line19Color: coral gnuplot*line20Color: black, 0.5 gnuplot*line21Color: blue gnuplot*line22Color: red gnuplot*line23Color: green gnuplot*line24Color: magenta gnuplot*line25Color: cyan gnuplot*line26Color: sienna gnuplot*line27Color: black gnuplot*line28Color: orange gnuplot*line29Color: coral gnuplot*line30Color: black, 0.5 gnuplot*borderWidth: 2 gnuplot*axisWidth: 2 gnuplot*line1Width: 0 gnuplot*line2Width: 0 gnuplot*line3Width: 0 gnuplot*line4Width: 0 gnuplot*line5Width: 0 gnuplot*line6Width: 0 gnuplot*line7Width: 0 gnuplot*line8Width: 0 gnuplot*line9Width: 0 gnuplot*line10Width: 0 gnuplot*line11Width: 0 gnuplot*line12Width: 0 gnuplot*line13Width: 0 gnuplot*line14Width: 0 gnuplot*line15Width: 0 gnuplot*line16Width: 0 gnuplot*line17Width: 0 gnuplot*line18Width: 0 gnuplot*line19Width: 0 gnuplot*line20Width: 0 gnuplot*line21Width: 0 gnuplot*line22Width: 0 gnuplot*line23Width: 0 gnuplot*line24Width: 0 gnuplot*line25Width: 0 gnuplot*line26Width: 0 gnuplot*line27Width: 0 gnuplot*line28Width: 0 gnuplot*line29Width: 0 gnuplot*line30Width: 0 gnuplot*borderDashes: 0 gnuplot*axisDashes: 16 gnuplot*line1Dashes: 0 gnuplot*line2Dashes: 0 gnuplot*line3Dashes: 0 gnuplot*line4Dashes: 0 gnuplot*line5Dashes: 0 gnuplot*line6Dashes: 0 gnuplot*line7Dashes: 0 gnuplot*line8Dashes: 0 gnuplot*line9Dashes: 0 gnuplot*line10Dashes: 0 gnuplot*line11Dashes: 44 gnuplot*line12Dashes: 44 gnuplot*line13Dashes: 44 gnuplot*line14Dashes: 44 gnuplot*line15Dashes: 44 gnuplot*line16Dashes: 44 gnuplot*line17Dashes: 44 gnuplot*line18Dashes: 44 gnuplot*line19Dashes: 44 gnuplot*line20Dashes: 44 gnuplot*line21Dashes: 4444 gnuplot*line22Dashes: 4444 gnuplot*line23Dashes: 4444 gnuplot*line24Dashes: 4444 gnuplot*line25Dashes: 4444 gnuplot*line26Dashes: 4444 gnuplot*line27Dashes: 4444 gnuplot*line28Dashes: 4444 gnuplot*line29Dashes: 4444 gnuplot*line30Dashes: 4444 |
|
From:
<br...@ph...> - 2006-02-25 12:51:29
|
michele carlini wrote: > I wrote my own ~/.Xdefaults since I have to plot sth like 20 graphs. Incorrect conclusion. Just because you have many different graphs doesn't mean that changing X resources is necessary or helpful in distinguishing them. That's what the style arguments in the plot command are for. > My intention was to keep the same line style while changing colours for the > first 10 graphs... then to keep another line style & changing colours for the > next 10 graphs... and so on And what made you think you could specify that many line styles independently in your .Xdefaults? |
|
From: Ethan A M. <merritt@u.washington.edu> - 2006-02-25 18:48:24
|
I think you may misunderstand how x11 works. (1) gnuplot (or any other x11 application) does not read the .Xdefaults file by itself. Instead, the x11 server reads the file when you begin a new X-session, and applies the values in finds there to answer queries from any applications (like gnuplot) that run later. So editing the .Xdefaults has no automatic effect until the next x-session. You can force an update of the x-session values by typing: xrdb -merge < ~/.Xdefaults Even that, however, will not necessarily affect programs that are already running. (2) Setting a value for some particular X resource can only have an effect if a corresponding application actually asks for that value by name. gnuplot does have a list of X resource values that it asks for, but your "gnuplot*line30Width", for instance, is not one of them. -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |
|
From: Ethan A M. <merritt@u.washington.edu> - 2006-02-25 19:07:26
|
On Saturday 25 February 2006 10:47 am, Ethan A Merritt wrote: > You can force an update of the x-session values > by typing: > xrdb -merge < ~/.Xdefaults Bleah. Sorry. That should have been cat ~/.Xdefaults | xrdb -merge -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |
|
From: Dave D. <dde...@es...> - 2006-02-27 11:08:11
|
Ethan A Merritt <merritt@u.washington.edu> writes:
> I think you may misunderstand how x11 works.
>
> (1)
> gnuplot (or any other x11 application) does not read the .Xdefaults
> file by itself.
Instead, the x11 server reads the file when you
> begin a new X-session, and applies the values in finds there to
> answer queries from any applications (like gnuplot) that run later.
I don't think that's the entire story.
On linux (hostname "twoflower"):
$ echo test | strace -f gnuplot
...
open("/usr/lib/X11/app-defaults/Gnuplot", O_RDONLY) = -1 ENOENT (No such file or directory)
...
uname({sys="Linux", node="twoflower", ...}) = 0
open("/home/eclipse/ddenholm/.Xdefaults-twoflower", O_RDONLY) = -1 ENOENT (No such file or directory)
On solaris (hostname "eclipse")
$ echo test | truss -f gnuplot
16820: open("/usr/lib/X11/app-defaults/Gnuplot", O_RDONLY) Err#2 ENOENT
...
16820: sysinfo(SI_HOSTNAME, "eclipse", 64) = 8
16820: open("/home/eclipse/ddenholm/.Xdefaults-eclipse", O_RDONLY) = 6
16820: xstat(2, "/home/eclipse/ddenholm/.Xdefaults-eclipse", 0x08046C94) = 0
so on my local setup at least, the application itself is looking for
files with application defaults. It actually seems to append the local
hostname to the filename - in both cases, DISPLAY was eclipse.
dd
--
Dave Denholm <dde...@es...> http://www.esmertec.com
|
|
From: Reiner S. <rei...@im...> - 2006-02-26 13:34:30
|
On Sat, Feb 25 2006, Ethan A Merritt wrote:
> On Saturday 25 February 2006 10:47 am, Ethan A Merritt wrote:
>> gnuplot (or any other x11 application) does not read the .Xdefaults
>> file by itself. Instead, the x11 server reads the file when you
>> begin a new X-session, and applies the values in finds there to
>> answer queries from any applications (like gnuplot) that run later.
Maybe better use ~/.Xresources instead of ~/.Xdefaults; see X(1).
>> You can force an update of the x-session values
>> by typing:
>> xrdb -merge < ~/.Xdefaults
>
> Bleah. Sorry. That should have been
> cat ~/.Xdefaults | xrdb -merge
What's the difference (apart from UUOC[1])?
(BTW, "xrdb -merge ~/.Xdefaults" should also work[2])
Bye, Reiner.
[1] Useless use of cat
[2] SYNOPSIS
xrdb [-option ...] [filename]
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
|
|
From: Ethan M. <merritt@u.washington.edu> - 2006-02-27 19:02:49
|
On Monday 27 February 2006 03:07 am, Dave Denholm wrote:
>> Instead, the x11 server reads the file when you
> > begin a new X-session, and applies the values in finds there to
> > answer queries from any applications (like gnuplot) that run later.
>
> I don't think that's the entire story.
I do not know whether it is some official policy change or just
natural selection, but the app-defaults mechanism does not seem
to be commonly used anymore. It used to be (back in R4/R5 days)
that most x11 applications came with a corresponding app-defaults
file. Now hardly any do. It did not help general users much
because it required root access to change, which I suspect is why
it fell out of favor.
Nevertheless, an app-defaults file can be a useful template for
modifying or adding entries to your personal configuration.
I have it on my TODO list to stuff the gnuplot_x11 X-resources
into an app-defaults file for that reason.
The traces you show below are very interesting. I did not know about
this at all. So you are quite right that my generic explanation was not
the end of the story. Thanks for the education!
Based on your traces, it seems one would need a separate
"~/.Xdefaults-<hostname>" file for each server.
Notice that it doesn't try to open the generic ~/.Xdefaults file.
[After a bit of poking through the gplt_x11.c code]
Huh. I see that the code does try to open such files, but apparently
it only does so if the window manager has not already initialized the
database:
server_defaults = XResourceManagerString(dpy);
[...]
if (server_defaults)
dbDef = XrmGetStringDatabase(server_defaults);
else {
strcpy(buffer, home);
strcat(buffer, "/.Xdefaults");
dbDef = XrmGetFileDatabase(buffer);
}
XrmMergeDatabases(dbDef, &db);
What a curious thing to do. So if your machine is properly
configured to initialize your X environment on startup, then
gnuplot_x11 will not look in the files. But if your machine is
not configured to use the standard mechanism, then
gnuplot_x11 will look for itself. I guess since my machines
initialize the database at the start of each X session, I've
never seen this.
I have always have to update the resource database myself,
using xrdb, in order to see the effect of any change in the
.Xdefaults file.
> On linux (hostname "twoflower"):
>
> $ echo test | strace -f gnuplot
>
> ...
> open("/usr/lib/X11/app-defaults/Gnuplot", O_RDONLY) = -1 ENOENT (No
> such file or directory) ...
> uname({sys="Linux", node="twoflower", ...}) = 0
> open("/home/eclipse/ddenholm/.Xdefaults-twoflower", O_RDONLY) = -1
> ENOENT (No such file or directory)
>
>
>
> On solaris (hostname "eclipse")
>
> $ echo test | truss -f gnuplot
>
> 16820: open("/usr/lib/X11/app-defaults/Gnuplot", O_RDONLY) Err#2
> ENOENT ...
> 16820: sysinfo(SI_HOSTNAME, "eclipse", 64) = 8
> 16820: open("/home/eclipse/ddenholm/.Xdefaults-eclipse", O_RDONLY) =
> 6 16820: xstat(2, "/home/eclipse/ddenholm/.Xdefaults-eclipse",
> 0x08046C94) = 0
>
>
>
> so on my local setup at least, the application itself is looking for
> files with application defaults. It actually seems to append the
> local hostname to the filename - in both cases, DISPLAY was eclipse.
>
>
>
> dd
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle WA
|
|
From: James R. V. Z. <jr...@co...> - 2006-02-28 02:46:32
|
>Ethan Merritt <merritt@u.washington.edu> wrote:
>the app-defaults mechanism does not seem
>to be commonly used anymore. It used to be (back in R4/R5 days)
>that most x11 applications came with a corresponding app-defaults
>file....
>
>Nevertheless, an app-defaults file can be a useful template for
>modifying or adding entries to your personal configuration.
>I have it on my TODO list to stuff the gnuplot_x11 X-resources
>into an app-defaults file for that reason.
I like the app-defaults file mechanism. It gives the packager or
system administrator a way to tune the application, which the
individual user can still override. (On a Debian system, they go in
/etc/X11/app-defaults. I have 63 of them on this system.)
>Based on your traces, it seems one would need a separate
>"~/.Xdefaults-<hostname>" file for each server.
Actually, a file for each client. I use this mechanism to
set a different background color for each machine, so I can tell
at a glance which windows came from which machine.
>
>[After a bit of poking through the gplt_x11.c code]
>
>Huh. I see that the code does try to open such files, but apparently
>it only does so if the window manager has not already initialized the
>database: ...
Hmm. That doesn't match the X manual:
XENVIRONMENT
This must point to a file containing X resources. The
default is $HOME/.Xdefaults-<hostname>. Unlike
__projectroot__/lib/X11/Xresources, it is consulted each
time an X application starts.
Is that a recent change to the code? (I don't have current versions
of gnuplot running everywhere.)
- Jim Van Zandt
|
|
From: Ethan A M. <merritt@u.washington.edu> - 2006-02-28 04:19:29
|
On Monday 27 February 2006 06:46 pm, James R. Van Zandt wrote:
> >"~/.Xdefaults-<hostname>" file for each server.
>
> Actually, a file for each client. I use this mechanism to
> set a different background color for each machine, so I can tell
> at a glance which windows came from which machine.
I used to do that, but somewhere along the way I switched over
to ssh-ing from inside whatever terminal I was currently in.
At that point it's too late to change colorschemes.
But I do have all my login scripts reset the title bar of
the current window to the machine just logged into.
> >Huh. I see that the code does try to open such files, but apparently
> >it only does so if the window manager has not already initialized the
> >database: ...
>
> Hmm. That doesn't match the X manual:
> Is that a recent change to the code?
[trimmed to show relevant lines]
1.1 (lhecking 26-Mar-99): if (server_defaults)
1.1 (lhecking 26-Mar-99): dbDef = XrmGetStringDatabase(server_defaults);
1.1 (lhecking 26-Mar-99): else {
1.15 (lhecking 19-Oct-00): strcat(buffer, "/.Xdefaults");
1.1 (lhecking 26-Mar-99): dbDef = XrmGetFileDatabase(buffer);
Which I think means it dates back at least to version 3.7 days.
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|