Search code examples
pythoncsvwolfram-mathematica

Create a graph using Mathematica and Python


I was wondering how I would go about using Python to create a Graph with Mathematica. I want to be able to use python code to invoke mathematica to create a new graph, using data from a CSV file.


Solution

  • The old fashioned way to do what Yaroslav suggested is to just call the kernel (math) with the script switch e.g. math -script graph.m. Where graph.m is either constructed beforehand and will load the csv file or is constructed on the fly by your python program.

    Can I ask why you want to use Mathematica for making the graph? There are lots of python (and other) utilities that will do it for you. There are lots of options listed here: graph survey.