0

Not Yet Answered # graphing using python?

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!

Kharmak Gribouillis 1,313

0

0

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.

0

I think you should try **matplotlib**. See this code snippet http://www.daniweb.com/code/snippet216915.html and other examples here http://matplotlib.sourceforge.net/ (especially the gallery http://matplotlib.sourceforge.net/gallery.html).

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

Recommended Articles

Hi guys

I am developing a simple job card creator application with VB.net 2012, using Access 2010 as database.

The code I have generated to write data from a datagridview to the database table is successfully saving the data, but with an error "Parameter @name has no default value". The ...

get the input from user may include

-Bank balance

-Amount invested in business

-Amount given to other business partners as loan

and

-Amount payable to others

Made this in cpp.sh

Why would I need the x=y+1-1;?

x=y; just doesnt seem to work

Why is this?

And I know my coding ...