:py:mod:`BioSANS2020.gui_functs.draw_figure` ============================================ .. py:module:: BioSANS2020.gui_functs.draw_figure .. autoapi-nested-parse:: This is the draw_figure module This module controls how plots are drawn inside BioSANS canvas The following is the list of function for this module: 1. canvas_update_widgets 2. delete_this 3. draw_figure Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: BioSANS2020.gui_functs.draw_figure.canvas_update_widgets BioSANS2020.gui_functs.draw_figure.delete_this BioSANS2020.gui_functs.draw_figure.draw_figure .. py:function:: canvas_update_widgets(_, canvas) This function update the canvas upon adding new objects by moving objects to ensure they fit nicely. The arrangement is that the last object added appear first (latest goes on top). Args: canvas : the canvas object .. py:function:: delete_this(frame, canvas) This function removes objects from the canvas and reorder objects .. py:function:: draw_figure(items, figure, loc=(0, 0)) This function draws figure to the canvas by first adding a canvas object to the canvas, adding a frame to the newly created canvas and putting the figure to FigureCanvasTkAgg with frame as the parent. Args: items : 3 item list of [canvas, scroll_x, scroll_y] figure: the figure to be drawn in canvas i.e. plt.gcf() figure