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
  Python Matplotlib: How do I save (in pdf) all the graphs I create in a loop? JaneTan 1 535 Feb-28-2021, 06:20 PM
Last Post: Larz60+
  Color Formatting for Bar Graphs in a for loop adamszymanski 1 448 Jan-31-2021, 01:06 PM
Last Post: jefsummers
Photo Matlab to Python Sateesh 0 374 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 283 Nov-02-2020, 07:18 AM
Last Post: moose
  From Matlab to Python erbab 1 458 Oct-27-2020, 02:16 PM
Last Post: jefsummers
  Sharing X Axis in Sub plots JoeDainton123 1 617 Aug-22-2020, 04:11 AM
Last Post: deanhystad
  Help With Sub Plots JoeDainton123 0 490 Aug-20-2020, 10:48 PM
Last Post: JoeDainton123
  Arrays in MATLAB and PYTHON cokhuatlanyeuthuongconhetmuc 2 615 Jul-24-2020, 10:47 AM
Last Post: cokhuatlanyeuthuongconhetmuc
  Group scatter plots Mekala 0 474 Jul-23-2020, 02:18 PM
Last Post: Mekala
  How to merge strings through graphs Den 6 1,097 Jun-29-2020, 07:07 AM
Last Post: Den

Forum Jump:

User Panel Messages

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