Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Math Function Plotter GUI

Overview

The Math Function Plotter GUI is a desktop application designed to plot mathematical functions. Built using PySide2 for the GUI and Matplotlib for plotting, this application allows users to input mathematical expressions, specify the range for the x-axis, and view the resulting plot.

Features

  • Function Input: Users can enter mathematical functions with support for various operators and functions.
  • Range Specification: Define the x-axis range with minimum and maximum values.
  • Step Size: Set the interval between plotted points.
  • Plotting: Generate and display the graph based on user input.
  • Error Handling: Real-time validation of inputs with error messages.
  • Instructions: Access detailed instructions on how to use the application.

Supported Mathematical Functions

  • Operators: +, -, /, *, ^ (exponentiation)
  • Trigonometric Functions: sin(x), cos(x), tan(x), etc.
  • Square Root: sqrt(x)
  • Logarithms: log(x), log10(x), log2(x)
  • Constants: pi, e^x (as exp(x))

Program Interface

Screenshot from 2024-07-21 18-40-20

Instructions

Screenshot from 2024-07-21 18-06-00

Error Messages

The application provides feedback on input errors through visual cues. Below are descriptions of the various error states and corresponding images.

1. Plot Function is an Empty String

  • Description: This error occurs when the plot function input field is left empty. Screenshot from 2024-07-21 18-06-16

2. Plot Function is Not a Valid Mathematical Function

  • Description: This error indicates that the input provided for the plot function is not a valid mathematical expression. Screenshot from 2024-07-21 18-06-40

3. X Min is an Empty String

  • Description: This error is shown when the minimum x value input field is left empty. Screenshot from 2024-07-21 18-07-47

4. X Min is Not a Valid Number

  • Description: This error occurs when the minimum x value input is not a valid number. Screenshot from 2024-07-21 18-07-59

5. X Max is an Empty String

  • Description: This error appears when the maximum x value input field is left empty. Screenshot from 2024-07-21 18-08-11

6. X Max is Not a Valid Number

  • Description: This error is displayed when the maximum x value input is not a valid number. Screenshot from 2024-07-21 18-08-31

7. X Max is Not Greater Than X Min

  • Description: This error indicates that the maximum x value is not greater than the minimum x value. Screenshot from 2024-07-21 18-08-44

8. Step is an Empty String

  • Description: This error is shown when the step size input field is left empty. Screenshot from 2024-07-21 18-08-57

9. Step is Not a Valid Number

  • Description: This error appears when the step size input is not a valid number. Screenshot from 2024-07-21 18-09-13

10. Step is Zero

  • Description: This error occurs when the step size is set to zero. Screenshot from 2024-07-21 18-09-25

Successful plots:

  • f(x) = sin(x) Screenshot from 2024-07-21 18-09-43

  • f(x) = x^3 + 6*x^2 - 3*x + 6 image

Resources:

  1. Pyside2 documentation
  2. Parwiz Forogh - YouTube - Pyside2 playlist
  3. Geeks for geeks - Python Regex
  4. Corey Schafer - YouTube - Python Regex tutorial
  5. PythonGUIs - Matplotlib with Pyside2

About

Master Micro Python Task (Function Plotter), using PySide2 and Matplotlib.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages