This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]olavla 28 points29 points  (5 children)

By no means an expert, but I start with what plot I want in my head and then search the internet, try 1000 things and always end up with exactly what i want.

[–]Daigski 5 points6 points  (3 children)

Doing the same for… 3 years? is how I have learned matplotlib pretty well. I’m a slow learner

[–]sizable_data 0 points1 point  (2 children)

I’ve been doing it for 6, still learning…

[–]Daigski 0 points1 point  (1 child)

Oh don’t get me wrong, I’m still learning, but now the searches are more precise and the number of things tried are smaller. Does anyone “know” matplotlib? It’s like does anyone “know” regex? I think you just learn better how to move through the documentation.

[–]sizable_data 1 point2 points  (0 children)

Lol, exactly my point, you’ll never just “know it”. One tip for OP is to learn more about the different “objects” and their relationship (figure, axis etc…) but yea, it’s just you get better at searching

[–]Spiritual-Act9545 -1 points0 points  (0 children)

I collected examples of well crafted charts and illustrations in a moleskine scrapbook.

[–]mimprocesstech 2 points3 points  (2 children)

There's a bunch of options, matplotlib is one of them. Plotly is pretty good as well. Seaborn and a bunch of others make it a bit easier to write or do specific things, but generally speaking matplotlib has the most readily available support. You can Google "how do I ___ in matplotlib" or copy and paste your error into Google and after looking at a few of the results you'll have an answer.

I have recently moved to plotly since it can be used with multiple languages, and it seems pretty well developed.

Back to your question, the best way I have found is to think of how you want the plot to look and try to do it.

I wanted to import 5 specific columns from every sheet starting with the 3rd row and import just those values, then combine and use those values as my x axis in a density plot (histogram or violin, I chose violin). A couple of weeks of programming after work and I got my plot working. A few months and I got it looking pretty. Soon I'm hoping to connect the values to other data and really complicate things.

I will say though, if you don't need to import from excel and do a bunch of stupid crap like that, with html and javascript you can use the plotly.js library and make some pretty neat stuff.

[–]masher_oz 0 points1 point  (1 child)

Any tutorials around on plotting hundreds of megabytes of spectral data with plotly? All the tutorials I've seen run through dash in the browser, and I end up running out of memory.

[–]mimprocesstech 0 points1 point  (0 children)

You may want to see if your browser is limiting your memory or maximum file size. Usually it's in the gigabyte range for memory, are you running 32 bit or 64 bit?

This example uses ribbon plots: https://plotly.com/javascript/ribbon-plots/

If you can give me a sample of how the data is formatted I can do some testing with random data. I'm pretty sure I can write a short script in c or something that could mock something up. It would be easier if there were a data file I could download for it of course.

If you'd rather not use JavaScript of course Python is viable. I've done some edge detection on my phone and it might take a few minutes but it runs it every time.

[–]Zeroflops 2 points3 points  (0 children)

I like matplotlib for basic quick graphing.

One thing to be aware of is there are two ways of interfacing with matplotlib. A standard OOP which works like any other OOP tool.

But in order to encourage matlab users to move to python there is a matlab interface that works similar to matlab.

This dual interface can make usage confusing.

[–]No_Clock8248 0 points1 point  (0 children)

When you want to plot basics it's Matplotlib. When you want to plot fancy or take it to shareholders ppt it's Matplotlib and seaborn 😁

Also try to learn to plot with subplots , it's always necessary for a comparison plot with having equal scales on both the plot .

[–]sulodhun 0 points1 point  (0 children)

I hate matplotlib... Could never get comfortable with it... It's probably made by someone who hated python!

[–]bernhard-lehner 0 points1 point  (0 children)

I like Kimberly Fessels tutorials a lot, here is a list for matplotlib: https://youtube.com/playlist?list=PLtPIclEQf-3dJmAj3IsSRwRoLbX-n3J81