I think a lot of plot programs take the dimensions of the plot from the values being plotted. I've sometimes wished for some kind of "frame" option to allow us to force the dimensions to avoid this variability. It's especially annoying when you compare separate plots of similar but different things like different currencies. Some currencies move within much tighter bands than others for various reasons (like being tied to the US dollar) but the different frame sizes make this non-obvious visually until you pay close attention to the values on the Y axis and see that the variability of one currency completely swamps that of another.
On Mon, Mar 21, 2022 at 5:48 PM Elijah Stone <[email protected]> wrote: > (A side note: does anyone know why when I post REPL session > transcriptions, they become misaligned?) > > On Mon, 21 Mar 2022, Elijah Stone wrote: > > > On Mon, 21 Mar 2022, Martin Kreuzer wrote: > > > >> [I'm writing under the influence of a (so long) mild attack of big C, > so > >> beg your pardon if reads a bit incoherently in places.] > > > > Sad to hear that. Hope you get better soon. > > > > > >> When plotting a unit circle (using pd commands and options) I got > >> disappointed again as it looked like a ballon from last weeks birthday > >> party. > > > > When I run the following: > > > > plot r.2p1 * 128 %~ i.128 > > > > I get something that looks stretched out and disappointing. But the > > aspect ratio follows the window size. If, instead, I run this: > > > > 'aspect 1' plot r.2p1 * 128 %~ i.129 > > > > The aspect ratio remains fixed regardless of the window size, and I get > > something that looks like a circle. > > > > On to the issue of the hexagon: > > > > pd'reset' > > pd'aspect 1' > > pd r.2p1*6%~i.7 > > pd'show' > > > > If I do this, I get a slightly distorted hexagon. However, if I > inscribe > > it in a circle, it looks correct: > > > > pd r.2p1*128%~i.129 > > pd'show' > > > > So I think it is a bug in plot. The aspect ratio is being computed > > relative to the max/min bounds of the function being plotted, not in > > absolute terms. > > > > So where does 0.866 come from? We can find the max/min bounds of the > > points in our hexagon, and thereby find the (incorrect) aspect ratio > used > > by plot: > > > > +. p=. r.2p1*6%~i.6 > > 1 0 > > 0.5 0.866025 > > _0.5 0.866025 > > _1 1.22465e_16 > > _0.5 _0.866025 > > 0.5 _0.866025 > > (>./ - <./)+.p > > 2 1.73205 > > %/(>./ - <./)+.p > > 1.1547 > > > > plot is using ~1.1547 as its aspect ratio, so we need the reciprocal, > > which is ~0.866. 0.866 is also visible in p, as it really comes from > > 1 o. o. %3. And yes, it really is -:%:3. > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA Quantitative Consultant ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
