Create a graph using Mathematica and Python

I was wondering how I will use Python to create graphics with Mathematica. I want to be able to use python code to call math to create a new graph using data from a CSV file.

+4
source share
4 answers

The old-fashioned way to do what Yaroslav suggested is to simply call the kernel ( math ) using a script switch, for example math -script graph.m . Where graph.m either pre-engineered, or loads a csv file, or is created on the fly by your python program.

May I ask why you want to use Mathematica to create a graph? There are many python utilities (and others) that will do this for you. Many options are presented here: chart overview .

+2
source

You probably need to look at PYML , which provides the Python API for Mathematica.

Depending on your needs, you can also look at matplotlib , which will allow you to execute graphics in Python.

+2
source

You can make a Mathematica shell script and call it from Python using os.system()

+2
source

Generating a graph in Python can be challenging, but a few simple steps can help you easily create a graph. To generate graphs in Python, you need the Matplotlib library. This helps to visualize your data and allows you to see the relationship between different variables. Before starting with the graph, it is important to first understand Matplotlib and its functions in Python. Read more https://www.probytes.net/blog/plotting-graphs-in-python/

0
source

Source: https://habr.com/ru/post/1332421/


All Articles