Python Forum
Python Matplotlib: Create chart for every 4 columns in Excel file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Matplotlib: Create chart for every 4 columns in Excel file
#1
Hi

I want to loop through every 4 columns in an Excel file and create line charts in a pdf file.

There is no upload function for me to show my Excel file as sample.

Basically create 4 lines in a single chart for Column B-E, another 4 lines in a 2nd single chart for Column F-I.
Column A will be the date, or x-axis in the charts

The excel file could have many set of 4 columns, so the code must loop through all of them and create all the charts in a single pdf file (1 chart per page).

How do I do so?

THank you
Reply
#2
go to pypi.org and search for the packages that you will need to complete.
--------------------
for excel, visit: https://pypi.org/search/?q=excel

There are also published guides available (which may or may not be biased) for example, for excel
see: https://www.python-excel.org/

openpyxl is a good choice: https://pypi.org/project/openpyxl/

--------------------
For PDF, there are again many packages available
visit: https://pypi.org/search/?q=pdf&o=

Report Lab: https://www.reportlab.com/opensource/
is praised as being an excellent choice (my experience is limited, so refrain from adding my opinion)
Reply
#3
Hi

I want to use Mathplotlib for it. Basically, it should loop through every 4 columns in my Excel file and create a separate graph for every 4 column

Every 4 columns will be the Revenue, Cost, Wage and Profit for a firm. The graph for each firm will have the 4 lines for Revenue, Cost, Wage and Profit

Thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python openyxl not updating Excel file MrBean12 1 249 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Copy Paste excel files based on the first letters of the file name Viento 2 346 Feb-07-2024, 12:24 PM
Last Post: Viento
  Create Choices from .ods file columns cspower 3 518 Dec-28-2023, 09:59 PM
Last Post: deanhystad
  How to create a table with different sizes of columns in MS word pepe 8 1,413 Dec-08-2023, 07:31 PM
Last Post: Pedroski55
  Recommended way to read/create PDF file? Winfried 3 2,783 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  Use PM4PY and create working file thomaskissas33 0 573 Nov-14-2023, 06:53 AM
Last Post: thomaskissas33
  Create csv file with 4 columns for process mining thomaskissas33 3 691 Nov-06-2023, 09:36 PM
Last Post: deanhystad
  Search Excel File with a list of values huzzug 4 1,147 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Updating sharepoint excel file odd results cubangt 1 752 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  create exe file for linux? korenron 2 908 Mar-22-2023, 01:42 PM
Last Post: korenron

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020