KekLib.DebugPlot#

DebugPlot.py

work-around to debug with matplotlib under tkinter

Copyright (c) 2018-2024, Masatsuyo Takahashi, KEK-PF

class DebugPlot(parent, scrollable=False, window_title=None, guide_message=None, ok_only=None, ok_text=None, button_spec=None, **kwargs)#

Bases: Dialog

Initialize a dialog.

Parameters:
  • window (parent -- a parent)

  • title (title -- the dialog)

abort()#
add_frame()#
apply()#

process the data

This method is called automatically to process the data, after the dialog is destroyed. By default, it does nothing.

body(body_frame)#

create dialog body.

return widget that should have initial focus. This method should be overridden, and is called by the __init__ method.

buttonbox()#

add standard button box.

override if you do not want the standard buttons

destroy()#

Destroy the window

draw()#
figure(*args, **kwargs)#
guide_message#

Call to self.body must be delayed until the figure for FigureCanvasTkAgg become available. Be aware that this is not yet a Tk widget. E.g., you can’t Dialog.destroy this instance.

kill()#
my_buttonbox(frame)#
show(block=True, pause=None)#
There are following two cases.

Case (1) Case (2) dp = DebugPlot(root) dp = DebugPlot(root)

fig = plt.figure() ax = fig.gca()

plt.plot(…) ax.plot() plt.show() plt.show()

class DialogWrapper(**kwargs)#

Bases: object

class Dp(**kwargs)#

Bases: object

annotate(*args, **kwargs)#
axes(*args, **kwargs)#
cla()#
clf()#
close()#
debug_plot_close()#
debug_plot_ok()#
exec_in_threaded_mainloop(closure)#
figure(*args, **kwargs)#
gca()#
gcf()#
get_current_dialog()#
get_dp()#
get_parent()#
legend()#
plot(*args, **kwargs)#
pop()#
push(**kwargs)#
quit_threaded_mainloop()#
set_global_opts(**kwargs)#
set_plot_env(parent=None, sub_parent=None)#
setp(*args, **kwargs)#
show(block=True, pause=None)#
subplots(*args, **kwargs)#
subplots_adjust(*args, **kwargs)#
switch_backend(*args)#
tight_layout()#
update()#

required in animation to get button events, etc.