App timer slows when mousing over plot

4 Ansichten (letzte 30 Tage)
Jane Sprigg
Jane Sprigg am 29 Sep. 2022
Kommentiert: Jane Sprigg am 30 Sep. 2022
The timer I'm using to update a plot slows down or stalls when I mouse over a plot (not necessarily one it's updating). Basically as long as I move my mouse I can stall the timer, so I get delays of 3s+ easily. The timer is supposed to run every 30ms (it isn't, but that's probably a different problem).
I've disabled Toolbars, HitTest, Pickable Parts. I'm using set to update the plot. Do I need to disable something else?
This is what the plot axes properties shows:
AlignVertexCenters: off
Annotation: [1×1 matlab.graphics.eventdata.Annotation]
BeingDeleted: off
BusyAction: 'cancel'
ButtonDownFcn: ''
Children: [0×0 GraphicsPlaceholder]
Clipping: on
Color: [0 0.4470 0.7410]
ColorMode: 'auto'
ContextMenu: [0×0 GraphicsPlaceholder]
CreateFcn: ''
DataTipTemplate: [1×1 matlab.graphics.datatip.DataTipTemplate]
DeleteFcn: ''
DisplayName: ''
HandleVisibility: 'on'
HitTest: off
Interruptible: on
LineJoin: 'round'
LineStyle: '-'
LineStyleMode: 'auto'
LineWidth: 0.5000
Marker: 'none'
MarkerEdgeColor: 'auto'
MarkerFaceColor: 'none'
MarkerIndices: [1 2]
MarkerMode: 'auto'
MarkerSize: 6
Parent: [1×1 UIAxes]
PickableParts: 'none'
Selected: off
SelectionHighlight: on
SeriesIndex: 1
SourceTable: [0×0 table]
Tag: ''
Type: 'line'
UserData: []
Visible: on
XData: [1 2]
XDataMode: 'auto'
XDataSource: ''
XVariable: ''
YData: [0 0]
YDataMode: 'manual'
YDataSource: ''
YVariable: ''
ZData: [1×0 double]
ZDataMode: 'auto'
ZDataSource: ''
ZVariable: ''
This is what InstantPeriod shows for the timer. Right side is me moving the mouse.

Akzeptierte Antwort

Eric Delgado
Eric Delgado am 30 Sep. 2022
Bearbeitet: Eric Delgado am 30 Sep. 2022
uifigure is not the best idea if you are looking for performance... see other posts about it and maybe you gonna use the old figure. :)
Anyway... you going to have a significant improvement in performance by turning off the "DefaultInteractivity" (it's all fault of DataTip Interaction!), "XLimMode" and "YLimMode" properties and update only "YData". See attached app made on R2021b.
And you still will have the axes toolbar for interaction, but if you disable it, it's gonna be even better!
disableDefaultInteractivity(app.UIAxes)
  5 Kommentare
Eric Delgado
Eric Delgado am 30 Sep. 2022
You should use "hold" to keep DefaultInteractivity disable. Try this:
disableDefaultInteractivity(app.Receive1Plot)
hold(app.Receive1Plot, 'on')
Jane Sprigg
Jane Sprigg am 30 Sep. 2022
Oh that's ridiculous. That did work, thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by