Hi Paul,
thank you for responding. I indeed overlooked, that units="inch" gives
stable results, independent of resizing the graphics window on the screen.
And indeed I would find some way fiddling around to get my graphic done.
However I see a general problem here and I would like a general solution:
Obviously we are dealing with two coordinate systems: the graphics device
size (call it representation layer) and the window size on the screen (call
it presentation layer). If I do any graphics programming, I do not want to
depend on arbitrary window sizes. It is nice to know my device has 8 inches
and that text x needs y inches in width. But the adress space in which
plotting is done are the "user" coordinates. So, for the simplest example,
specifying xlim=c(0,1) generates a stable reference WHICH DOES NOT CHANGE ON
RESIZING THE GRAPHICS WINDOW. As strwidth(units="user") DOES CHANGE ON
RESIZING THE GRAPHICS WINDOW the units arguably ARE NOT the user
coordinates.
I tend to believe this is a BUG. Same for units="figure".
I also tend to believe, that resizing a graphics window should rescale the
font size used ON SCREEN, because currently we have the following mixup of
representation layer and presentation layer: if a certain text in cex=1
fills 50% width of my user coordinates on the device, and I decrease window
size, with stable screen font size the same text now fills more than 50%
width. This 'more' is reflected in strwidth(units='user'), but as said
before, the units strwidth(units='user') gives are not user but
user*(device/window). So if a special strwidth measure is needed which
refers to the presentation layer it should be named accordingly. Those
units='user' and units='figure' should return stable measures refering to
the representation layer.
Regards
Jens
version
_
platform Windows
arch x86
os Win32
system x86, Win32
status
major 1
minor 1.1
year 2000
month August
day 15
language R
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi
[This also a reply to "[Rd] Another inconsistency concerning device-size vs.
window-size"]
I will try to give a brief overview of the way R graphics devices
(conceptually at least) work (to me at least).
Yes a window (x11 or win32) is a device. Other devices are: postscript,
png, jpeg, pictex, bmp. Windows are different to these other devices
because they can be interactively resized. R treats a change in window size
as a change in the (absolute) physical size of the device. Perhaps another
way to respond to a window resize would be to retain the same physical
device size and have scroll bars on the window, but I don't think this is
still what you would want (?)
Text size is most often specified (ultmately) as a physical (absolute)
pointsize. The reason for this (I think) is that ultimately text has to be
big enough to read. Thus strwidth() will return the same answer in any
absolute set of units (e.g., "inch"). The correct interpretation of
strwidth(mytext, "user") is that it is the physical size of the text
_converted_ into user coordinates.
Automatic resizing of text is a tricky issue. The text size is
automatically resized by R in some cases (e.g., for multiple figures), but
scaling text size continuously (e.g., with window size) does not tend to
produce useful results (e.g., it is too easy to produce text which is too
small to read).
I suspect that I'm not providing you with the answer you want; I guess I'm
trying to explain how R works so that you can do what you need to. Perhaps
it would help me to help you more if you described the graphics task you are
trying to achieve (?).
With respect to the par("din") inconsistency, that _is_ undesirable
behaviour. The correct behaviour is the second one. Could you please
submit a bug report for this (including your example).
Thanks
Paul
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
R treats a change in window size as a change in the (absolute) physical
size of the device.
Well, as to be expected by Murphy's law, this is the worst possible case.
[snipped]
With respect to the par("din") inconsistency, that _is_ undesirable
behaviour. The correct behaviour is the second one. Could you please
submit a bug report for this (including your example).
Paul, I'd not like to submit a bug report to resolve the par("din")
inconsistency by making it consistently 'the second one'. Rather I try to
convince you (and r-devel) making it consistently 'the first one'. I
consider the following features to be indispensable:
1) presentation-layer vs. representation-layer
Keep physical size of the device striktly seperated from window size,
i.e. do not change par("din") with window resizing.
2) Text size
Keep text size stable with respect to device size,
i.e. resize text size with window size
3) strwidth() and strheight()
those should consistently refer to the representation layer, or to be more
general: the R-user/R-programmer should always work within the context of
the representation layer, and he should be isolated against the presentation
layer (where obvioulsy some C-Coding is acting, to put things on screen).
Here is the resoning for this:
a)
Let's start with a rather abstract reason: proper separation of 'layers' is
one of the cornerstones of professional software design. A good example is
the current/old thrive for seperation of content and layout (XML/LaTeX).
Currently R blends representation and presentation, which is no good.
b)
For a more practical reason. Seperating the layers gives more options, more
degrees of freedom to use the software. Currently there is no way to layout
a big device like DIN A3, because the windows always is smaller and it gets
impossible to create a DIN A3 device which can be changed INTERACTIVELY
(i.e. x11()). Seperating layers allows everything which currently works plus
more. For example Font sizes. You argue, that resizing fonts with window
size could result in smalls too small to read. Well, it could. But you would
be free to create a device of exactly the window size, and you would be free
to specify any font size when creating the device. To put ot more
provocative: Currently R has an MS like approach of software trying to be
more intelligent than it's user, something I always hated about products
like MS Word. Currently there are situations without any resonable
workaround in R. Seperating layers gives you every option and full control.
As you suggest, adding something like scrolling or zooming to windows would
be a nice extension. However, proper seperation of layers should have
priority: it's a must.
c)
For a reason of authority and compatibility: the prototype DOES layer
seperation, DOES rescaling of fonts with window size. Let's dare to be as
good as the prototype, or better ...
I hope all this is convincing. As the graphics flexibility of R is one of
the reasons to use it, having reduced degrees of freedom is disappointing.
To put it provocative:
tool or toy, that's the question here
Please give feedback
Regards
Jens
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
.............
...........
Jens> c)
Jens> For a reason of authority and compatibility: the prototype DOES
Jens> layer seperation, DOES rescaling of fonts with window size.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
absolutely not!
{unless you are talking Axum graphics which I hardly know and which
definitely are *NOT* part of the prototype!}
Jens> Let's dare to be as good as the prototype, or better ...
That has been one of the major motivations behind R development
and I think we *are* slightly better in lower level graphics
Jens> I hope all this is convincing.
more or less.
I think there is more than one way of layer separation and we *are* more or
less adhering to one..
Our problem has been to try to remain prototype compatible in many ways and
still do well. In the realm of graphics this is close to impossible if you
look closely...
Jens> As the graphics flexibility of R
Jens> is one of the reasons to use it, having reduced degrees of
Jens> freedom is disappointing. To put it provocative:
Jens> tool or toy, that's the question here
(you could be somewhat kinder here ...)
Jens> Please give feedback
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Jens> For a reason of authority and compatibility: the
prototype DOES
Jens> layer seperation, DOES rescaling of fonts with window size.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
absolutely not!
{unless you are talking Axum graphics which I hardly know and which
definitely are *NOT* part of the prototype!}
well, my experience with the prototype is somewhat outdated (WinS+3.3 DID
not change device size with window resizing and DID rescaling of fonts with
window size)
I think there is more than one way of layer separation and we
*are* more or
less adhering to one..
well, the dependance of strwidth() on actual windowsize somehow is an
counter-example, don't you think?
Jens> As the graphics flexibility of R
Jens> is one of the reasons to use it, having reduced degrees of
Jens> freedom is disappointing. To put it provocative:
Jens> tool or toy, that's the question here
(you could be somewhat kinder here ...)
Definitely. I know that R is an incredible usefull and serious piece of
software, and my hope is to tickle people to make it better. It's not my
intention to really provoke someone. However, I think it is a serious issue,
and the current implementation seriously restricts R's usefullness as an
universal tools for creating data-driven graphs. And, as I tried to explain,
there is no need for this restriction.
More feedback welcome.
Jens
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._