Python Forum
Python v MatLab for graphs and plots
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python v MatLab for graphs and plots
#1
I need to generate some graphs of data from an Excel sheet. I installed a trial version of MatLab and played with it a bit. It can certainly do what I need.

Then a friend said I should use Python instead. He had not used it for graphing, but had heard that it had library functions especially for graphing. So before I spend a lot of money to buy MatLab, I thought I ask here about graphing with Python.

Here's a graph that I produced with a very old shareware graphing program. The data is blood glucose readings for a diabetic. Then I used a graphics program to add the shading. The green areas are good readings, the red are not so good.

[Image: Sample%20Graph%203%20periods%20new.jpg?dl=0]

How difficult would it be for me to learn enough Python to generate a graph like this?

And where would I go to read up on how?

And does anyone have experience with both Python and MatLab and can give their opinion on which would be better?

Thanks for any help and any pointers.
Reply
#2
Two libraries to look at are Matplotlib and Seaborn. Python and these libraries are widely used in academia, like MATLAB is, so producing high quality, complex plots isn't a problem.
Reply
#3
(Apr-22-2020, 11:46 AM)ndc85430 Wrote: Two libraries to look at are Matplotlib and Seaborn. Python and these libraries are widely used in academia, like MATLAB is, so producing high quality, complex plots isn't a problem.

Thanks, Minister, that is exactly what I was looking for. It looks like I have a lot of reading to do.
Reply
#4
(Apr-22-2020, 01:16 PM)CynthiaMoore Wrote: I need to generate some graphs of data from an Excel sheet.
For this in Python is Pandas useful.
import pandas as pd

df = pd.read_excel('file_example.xlsx')
Also is easier to plot and do stuff if use Jupyter Notebook.

Can also do this online with no installation eg trough Google Colab.
Here is a demo of doing this with Pandas in a Notebook,some cleaning up like Date.
Then can plot,can also trow in Altair.
Here is the NoteBook

So all i have done here is with no installation,libraries as mention @ndc85430 is all pre-installed.
Pandas uses matplotlib internally when do plot,as you see i don't need to import it.
Reply
#5
Thanks, snippsat, I will check into all of that. It looks like there are plenty of tools for what I need to do.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question written RK solving same equation with different graphs acbshinn 1 342 Feb-09-2024, 12:33 PM
Last Post: Gribouillis
  Multiple Plots in Spyder PythonAndMe2023 0 816 Feb-03-2023, 07:00 PM
Last Post: PythonAndMe2023
  Graphs from Jupyter notebook to word Scott 0 837 Nov-28-2022, 06:16 AM
Last Post: Scott
  Plot several graphs on the same row Menthix 1 1,002 Mar-18-2022, 05:47 PM
Last Post: deanhystad
  grouped bar graphs tobiasfw 1 1,372 Feb-22-2022, 02:25 PM
Last Post: deanhystad
  Subplot - Plotting 4 plots on the same row Menthix 1 1,392 Nov-07-2021, 09:03 PM
Last Post: deanhystad
  Python Matplotlib: How do I save (in pdf) all the graphs I create in a loop? JaneTan 1 8,780 Feb-28-2021, 06:20 PM
Last Post: Larz60+
  Color Formatting for Bar Graphs in a for loop adamszymanski 1 2,888 Jan-31-2021, 01:06 PM
Last Post: jefsummers
Photo Matlab to Python Sateesh 0 1,636 Nov-04-2020, 09:11 AM
Last Post: Sateesh
  How can I scroll over my data points when creating plots in Python? (I'm using Spyder moose 0 1,582 Nov-02-2020, 07:18 AM
Last Post: moose

Forum Jump:

User Panel Messages

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