Giter VIP home page Giter VIP logo

function-plotter's Introduction

Function Plotter

Function Plotter is a Python application built with PySide2 and Matplotlib that allows users to plot mathematical functions (e.g., 5x^3 + 2x) and visualize the results on a graphical interface.

Demo Trigno

Table of Contents

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/youssefkhaled08/Function-Plotter.git
  1. Navigate to the project directory:
cd function-plotter
  1. Create a virtual environment for the required dependencies:
virtualenv venv
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

Usage

  1. Run the Function Plotter.py file:

    python "Function Plotter.py"
    
  2. The Function Plotter application window will appear.

  3. Enter the equation of the function you want to plot in the "Function of X" field.

  4. Provide the minimum and maximum values of X in the corresponding fields.

  5. Click the "Plot" button to generate the plot.

  6. The plot graph will be displayed in the application window.

Common Mistakes

Invalid Function Invalid Input Missing Input
Invalid Function Invalid Function Missing Input

Code

Naming Convention

  • I followed the Camel Case Naming Convention.
  • When naming the GUI compnents, I started the name of each component with its type, such as ptnPlot for a button component, and txtFunction for a text input component. This way, it becomes easier to search and identify the purpose or functionality of each component just by looking at its name.

Validation Layer

Consists of 3 Layers:

  1. First layer: The validateUserInputs function checks if the user provided all required inputs or not, and provides an error message box for any missing input.
  2. Second Layer: The validateFunction function cheks if the inputted function in the right format.
    • It removes whitespaces from the inputted function.
    • Replaces ** with the ^ operator to support its funcionality.
    • Uses Regular Expressions to check if there's any invalid operator in the function, and provides an error message box that shows the unsupported operator.
  3. Third Layer: The validateUserInput function cheks if the user provided valid inputs for the minimum and maxiumu values of X, and provides an error message box for any invalid value.

Tests

Used Pytest to perform end to end testing. Positive Tests

Used Technologies


function-plotter's People

Contributors

youssefkhaled08 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.