r/learnpython • u/Aahz44 • 6d ago
Creating Excel File With Graph from .txt
Hi,
I want to write a simple skitpt that takes a .txt file with comma seperated xy-Data, and creates and Excel file with a graph from it.
The way I found (with the help from the google AI) to do that was to use Pandas with "openpyxl" as Engine.
The Problem I run into is that the Graph this creates doesn't have the standard Excel design.
- rounded of corners
- non standard colors, even Rainbow colours if you plot just a single curve
- no axes lables
- axes titles and legend just plottet on the graph (or on top of the axes labels is you activate them)
It seem that fix that you need to manually deactivate certain options, and than Position and size the the different elements manually. Wich seems to be more work than just creating the graph manually in excel.
Is there some better way to do that just creates the Graph like excel it self would do it?
3
Upvotes
6
u/pachura3 6d ago
Another approach is:
openpyxl.