2
$\begingroup$

The following code:

 Table[
  Plot[Sin[a], {a, 0, i}, PlotRange -> {{i - 3600, i}, {-1, 1}}, 
   ImageSize -> 800, AspectRatio -> 0.2, Frame -> True, 
   PlotRangePadding -> 0, GridLines -> Automatic, 
   FrameLabel -> {{Style["SOME TEXT - m", 13], 
      None}, {Style["Time - s", 13], Style["THE TITLE", 13, Bold]}}, 
   Axes -> False],
  {i, 1, 10000, 100}
  ]

Generates jumpy labels, ticks and frames:

enter image description here

How can I get a less vibrating plot (not referring to the plotted line itself...)

EDIT:

The following is closer to my real case, and ImagePadding doesn't work:

Dynamic@ListLinePlot[Table[Sin[a], {a, i - 3600, i}], 
  PlotRange -> {{i - 3600, i}, {-1, 1}}, ImageSize -> 800, 
  AspectRatio -> 0.2, Frame -> True, PlotRangePadding -> 0, 
  GridLines -> Automatic, PlotStyle -> Thick, 
  FrameLabel -> {{Style["Something", 13], 
     None}, {Style["Time - s", 13], Style["SOMETHING", 13, Bold]}}, 
  Axes -> False, ImagePadding -> 50]
Do[Pause[0.1]; i = a, {a, 10, 1000000}]
$\endgroup$
7
  • $\begingroup$ The shortest solution ever... wait for it... ImagePadding -> 50 :) $\endgroup$
    – Kuba
    Commented Jul 5, 2013 at 22:48
  • $\begingroup$ @Kuba Sorry, it works on this example, but not on my real test. Give me some minutes try to choose a better test... $\endgroup$
    – P. Fonseca
    Commented Jul 5, 2013 at 22:50
  • $\begingroup$ I have faced this problem (the second one), with one pixel jumping. Bad alignment of objets was driving me crazy. I have failed trying to fix this. Notice that for notebook magnification different than 100% left ticks are standing still, in my case at least. $\endgroup$
    – Kuba
    Commented Jul 5, 2013 at 23:20
  • $\begingroup$ What version are you using? I have V9.0.1 (Mac) and in the second example the labels, vertical ticks and frame are still. $\endgroup$
    – Michael E2
    Commented Jul 5, 2013 at 23:38
  • $\begingroup$ You may find it less annoying with GridLines-> Noneand Do[Pause[0.01]; i = a, {a, 10, 1000000, 1}] $\endgroup$
    – DavidC
    Commented Jul 6, 2013 at 0:01

1 Answer 1

3
$\begingroup$

I think this could be an approach:

Dynamic@Grid[{{"", 
 Style["THE TITLE", Bold, Red, 14]}, {Style[
 Rotate[Text["SOME TEXT"], 90 Degree], Bold, Darker@Green, 14], 
 ListLinePlot[Table[Sin[a], {a, i - 3600, i}], 
 PlotRange -> {{i - 3600, i}, {-1.1, 1.1}}, ImageSize -> 800, 
 ImagePadding -> {{25, 5}, {20, 5}}, AspectRatio -> 0.2, 
 Frame -> True, GridLines -> None, PlotStyle -> Thick, 
 Axes -> False]}, {"", Style[Text["Time -s"], Bold, Blue, 14]}}, 
 Spacings -> {{0, 1}, {0, 0}}]
Do[Pause[0.000001]; i = a, {a, 10, 1000000}]

Result:

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ Left FrameTicks are jumping. Or only I see this? :) $\endgroup$
    – Kuba
    Commented Jul 6, 2013 at 7:58
  • $\begingroup$ @P.Fonseca And Kuba this left FrameTicks is driving me crazy... I think this must be a bug, as I've tried almost everything I could but the problem still persists... :-( $\endgroup$
    – Rod
    Commented Jul 7, 2013 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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