Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added docstrings to different functions #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions gui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ def popupInputHandler(self):


def Dropdown_Changed(self, current_color):
"""To change the color of drop-down menu
current_color: current color
"""
color = '#000000'
if current_color == 'Red':
color = '#FF0000'
Expand All @@ -405,6 +408,7 @@ def Dropdown_Changed(self, current_color):
self.color_input.insert(0, color)

def changeTheme(self):
"""To change the background theme"""
if self.bt_themeswitch['text'] == "Light Theme":
self.bt_themeswitch.configure(text="Dark Theme")
self.Canvas1.configure(background=_bgcolorlight)
Expand Down Expand Up @@ -519,6 +523,7 @@ def changeTheme(self):
self.rePlot(self.radiovar.get())

def resize_plot(self, event):
"""To resize the Plot"""
if gui_support.plotted:
gui_support.Plot(self.fx.get(), range(int(self.x_lower.get()),
int(self.x_upper.get())), self.color_input.get(),
Expand Down
2 changes: 2 additions & 0 deletions gui_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ def Plot_line(arrays, color_name, theme, canvas, line_style, file_path):


def init(top, gui, *args, **kwargs):
"""To initiate the GUI window"""
global w, top_level, root
w = gui
top_level = top
root = top


def destroy_window():
"""To close or destroy the current window"""
# Function which closes the window.
global top_level
top_level.destroy()
Expand Down
16 changes: 14 additions & 2 deletions lib/plotutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def create_y_values(func, xvals):

"""This function will create the ordinate values for the given function that is to be plotted"""
# Create function ordinate values
yvals = []
for x in xvals:
Expand All @@ -21,7 +21,19 @@ def create_y_values(func, xvals):
return yvals

def plot(func, xpoints, color_name, xlabel, ylabel, theme, gui, line_style, file_path, discrete=False):

"""This function will show the summary of the plotted function
func: function plotted
xpoints: points on x-axix
color_name: color of the plot
xlabel: label on x-axis
ylabel: label on y-axis
theme: background theme
gui: show in gui (true or false)
line_style: line style of plotted graph
file_path: path for saving the graph
discrete: discrete points )true or false)
(false by default)
"""
# Show plot summary
print('***** Plot Summary *****')
print("Funtion: {}".format(func))
Expand Down