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
  MetaTrader 5 and Python problems with RSI and Alligator chart integration arturolv 0 541 Nov-28-2024, 06:25 PM
Last Post: arturolv
  Radar (spider) chart in python - 360 evaluation quiz jedan_decko 0 834 Nov-26-2024, 09:52 PM
Last Post: jedan_decko
  docx file to pandas dataframe/excel iitip92 1 2,707 Jun-27-2024, 05:28 AM
Last Post: Pedroski55
  how to create video game mission chart?[SOLVED] kucingkembar 1 724 Jun-19-2024, 02:11 PM
Last Post: kucingkembar
  Python openyxl not updating Excel file MrBean12 1 2,112 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Copy Paste excel files based on the first letters of the file name Viento 2 1,602 Feb-07-2024, 12:24 PM
Last Post: Viento
  Create Choices from .ods file columns cspower 3 1,812 Dec-28-2023, 09:59 PM
Last Post: deanhystad
  How to create a table with different sizes of columns in MS word pepe 8 8,160 Dec-08-2023, 07:31 PM
Last Post: Pedroski55
  Recommended way to read/create PDF file? Winfried 3 5,019 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  Use PM4PY and create working file thomaskissas33 0 1,958 Nov-14-2023, 06:53 AM
Last Post: thomaskissas33

Forum Jump:

User Panel Messages

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