xyPlot Flashing

Comments

3 comments

  • Alec Maxwell

    Hi Aanand, 

    Any chance you could post the code where you are experiencing this issue, or describe in a bit more detail what exactly you are doing with the xyPlot and the simulation it would be easier for me to troubleshoot.

    thanks, 

    Alec

    0
    Comment actions Permalink
  • Aanand Bajaj

    https://drive.google.com/file/d/0B2HLdKzEI-mGU3dCTWtGUnRJNGs/view?usp=sharing

     

    The entire project is here

    0
    Comment actions Permalink
  • Support Admin

    Hi Aanand,

    It sounds like you have not set the manual attribute in the plot series to "true". There is a post on this topic in the Tips and Tricks section of the forum. 

    Essentially, when animating shapes on plots (that is, drawing/erasing points in quick succession), the plot will appear to flicker as the user notices the pause between erasing points and adding new points. You can stop this flickering effect by setting the manual attribute on the series to "true". When manual="true", the series will not erase or add points until the Update method is called. In this way you can erase the old points and add new ones at effectively the same time, removing the flicker altogether. 

    E.g.

    <xyPlot name="plotName">
    <series name="seriesName" manual="true" /> <!-- Set manual mode to true -->
    </xyPlot>

    <script>
    function updateAnimation()
    plotName.seriesName:Clear() -- clearing all previous points
    for i = 0, 10, 0.1 do -- adding new points
    var = math.sin(i)
    plotName.seriesName:Add(i, var)
    end
    plotName.seriesName:Update() -- calling update as last step
    end
    </script>
    0
    Comment actions Permalink

Please sign in to leave a comment.