7
$\begingroup$

Update

(original question below kept as is).

I can reproduce this on version 11.1.1 on windows 7 as well as 11.0.1. (restarted Mathematica). Interesting is that it only shows on 125% resolution. Here is a gif

enter image description here

I am using one monitor, LG monitor, Ultra wide 34" if that makes any difference.

enter image description here


Original question

I like to set resolution of notebook to 125% instead of default 100%. But this causes TreeForm to keep shaking all the time which makes it hard to see.

Is there a way to stop the shaking at higher resolution?

Here is a MWE

s = Expand[5*(Sin[x] y + x)/y + 8]
TreeForm[s]

No shaking when notebook at 100%. But shaking shows up when changing to 125%. Here is a small gif

enter image description here

I used 11.0.1 here, since my 11.1.1 is busy now running and I can't use it for few hrs. Will also try this on 11.1.1 once done.

I also noticed something interesting. If I change expression and remove the +5 at the end, the shaking stops ! So this

s = Expand[5*(Sin[x] y + x)/y ]
TreeForm[s]

Causes no shaking at 125%. But 5*(Sin[x] y + x)/y +5 does (since it is a little wider tree now?). I also noticed if I grab the TreeForm with the mouse and drag it wider the shaking stops ! But this is hard to do each time, as you can see, I had hard time holding it and expanding it using the mouse:

enter image description here

Windows 7, 64 bit. Does this happen on other platforms?

Update:

Tried answer below and only first one causes shaking. Here is gif

enter image description here

$\endgroup$
7
  • 1
    $\begingroup$ Can not reproduce the problem with V.11.1.1 running under OS X 10.10.2. $\endgroup$
    – m_goldberg
    Jul 8 '17 at 4:24
  • $\begingroup$ @m_goldberg thanks for trying it. This might then be windows specific issue or issue with 11.0.1. $\endgroup$
    – Nasser
    Jul 8 '17 at 4:47
  • $\begingroup$ I think so. I have tagged it accordingly. $\endgroup$
    – m_goldberg
    Jul 8 '17 at 4:53
  • 1
    $\begingroup$ I'm voting to close this question as off-topic because I and others cannot reproduce the problem the user is experiencing; I suspect it is being caused by some problem local to the OP's system. $\endgroup$
    – m_goldberg
    Jul 8 '17 at 21:52
  • 6
    $\begingroup$ This is a real problem on all platforms. TreeForm has a combination of Scaled sizes and Automatic ImageSize which can, in the current system, set up an unstable fixed point computation. The FE then allows that instability to be self-triggering (i.e., something changed, so better compute it again). But the conditions to trigger this have to be exactly so, and due to slightly different font metrics on different platforms, it's typically the case that an example that triggers it on one platform won't trigger it on another. $\endgroup$
    – John Fultz
    Jul 9 '17 at 5:06
4
$\begingroup$

Try the following:

s = Expand[5 (Sin[x] y + x)/y + 8];
RawBoxes @ ToBoxes @ TreeForm[s]

If that also exhibits shaking, then try the following:

RawBoxes @ ToBoxes @ TreeForm[s, PlotRangePadding->0]
RawBoxes @ ToBoxes @ TreeForm[s] /. _Scaled->0
TreeForm[s, VertexLabeling->None]
TreeForm[s, ImagePadding->0]
$\endgroup$
4
  • $\begingroup$ Thanks, I tried them all. First one only cause shaking actually. The last 4 do not. Will add gif now. $\endgroup$
    – Nasser
    Jul 9 '17 at 4:49
  • 4
    $\begingroup$ Another option which should fix it is to set a fully explicit ImageSize (both vertical and horizontal dimensions). $\endgroup$
    – John Fultz
    Jul 9 '17 at 5:08
  • $\begingroup$ @JohnFultz Thanks for the hint. Using TreeForm[s, ImageSize -> 300] and now it no longer shakes at 125% resolution. $\endgroup$
    – Nasser
    Jul 9 '17 at 5:32
  • 4
    $\begingroup$ @Nasser although a specification of a single dimension to ImageSize will definitely fix some problems (might even fix most of them), it's not guaranteed to fix all of them. Which is why I was careful to mention specifying both dimensions explicitly. $\endgroup$
    – John Fultz
    Jul 9 '17 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.