Hi! I'm trying to figure out if it's possible to graph a piecewise mathematical function using Python where the limits of the function are dependent on another variable (i.e., if a > b, graph f(x); if b > a, graph g(x)). I've been trying to google stuff about graphing, but it's just left me more confused. I'm fairly new to programming, so any suggestions would be appreciated!

Find a windows like API for Python, I think wxPython library is your best bet for getting started with a GUI. You will then have to place down a control to where you can render the Graph to the screen. You can read up on the wxPython documentation on how you can override the rendering of a given control to render your graph. The mathematical concepts such as function f of x and graph function g of x will be the core of you programming efforts. That should put you on the right track on where you should start.

(Optional) For parsing in custom functions defined by the end user like f of x (f(x)):
You will most likely want to read up on how you will take in the custom function defined by the user and I would suggest reading up on parsing techniques such as "Polish_notation" which can be found on Wikipedia. This will help with parsing parenthesis and most importantly ensuring order of operations.

This article has been dead for over six months. Start a new discussion instead.