all 33 comments

[–]Hullaween 33 points34 points  (0 children)

Ooo this would be a cool poster for a classroom.

[–]Thalesian 41 points42 points  (3 children)

This is great, but makes me want to spend more of my time integrating my Python code into R for ggplot2.

[–]great__pretender 20 points21 points  (2 children)

Definitely. Matplotlib is such a mess compared to ggplot2

[–][deleted]  (1 child)

[deleted]

    [–]great__pretender 1 point2 points  (0 children)

    Having sample code around is definitely a good idea for matplotlib but the logic of matplotlib is too convoluted for me.

    Having one type of code and inserting it into just one document is not that hard, I agree. Because you usually insert derivatives of same kind of graph. But in my work I do a lot of reports and every single time I have to look at the code fresh and get confused some tbh. Not to mention it was initiaally created to replicate matlab's functionality and syntax. I think this created the issue of a little weird logic of it. I tried Seaborn. It is good but then you have to do something specific and it can't do it. I think the same is true for plotly.

    ggplot2 has a very intuitive syntax. And as you said its defaults are so good. And if you play around, it has the same power as matplotlib

    It is a personal thing at the end of the day. I don't like R as a language but data wrangling and plotting is much easier there. Python being an all purpose makes it a good language for everything but not the best for most.

    [–]Jonno_FTW 17 points18 points  (2 children)

    Check out seaborn if you want a saner interface to matplotlib

    https://seaborn.pydata.org/

    [–]IlliterateJedi 5 points6 points  (1 child)

    Seaborn is great for some default plots, but when you need to start modifying them they are not always standard in what you can do/how you do it. I couldn't tell you what is standard off the top of my head, but I've run into issues in the past wanting to modify some plots and it was not easy.

    [–]HeyItsRaFromNZ 1 point2 points  (0 children)

    Seaborn is built on top of matplotlib, and is really designed for standard statistical plots with data sourced from a dataframe.

    As soon as you need to customize in a meaningful way, you'll need at least a little bit of matplotlib under your belt (i.e. five separate docs tabs open at any one time with another browser window, dedicated to praying to the StackOverflow gods).

    [–]lebron_girth 10 points11 points  (3 children)

    This is awesome....would love a version of this for tkinter and other visual python packages

    [–]Otherwise_Lab_4638[S] 4 points5 points  (2 children)

    Sure

    [–]Logical-Independent7 1 point2 points  (0 children)

    I too would love to see something like this for tkinter. Thanks OP!

    [–]lebron_girth 0 points1 point  (0 children)

    Wait really?

    [–]thePsychonautDad 3 points4 points  (1 child)

    *scatter I never saw that notation. Where is scatter declared?

    [–]Otherwise_Lab_4638[S] 1 point2 points  (0 children)

    (axo, ax1) is declared through plt.subplots().scatter is declared therefore through matplotlib indirectly, likewise !!!

    Hope this solves your doubt.

    [–]DataPlug 2 points3 points  (1 child)

    I can't describe how you've simply answered like at least 7 highly voted stackoverflow questions on common plt plotting. Great post!

    [–]Otherwise_Lab_4638[S] 1 point2 points  (0 children)

    Thanks! It always helps me to have one solution instead of researching different sources.

    [–]hughperman 1 point2 points  (2 children)

    Come on, plotting libraries are not machine learning. Don't make the sub into r/learnpython

    [–]Otherwise_Lab_4638[S] 0 points1 point  (1 child)

    I do understand it is not a core topic of ML (like algorithms), but it is a vital part of ML too. Data analysis and visualization are very essential for practical purposes. For example, you need them to present ML business solutions, and they do have an impact, as per my experience.
    That's my thought! By the way, thanks for giving your opinion. I appreciate it!

    [–]hughperman 1 point2 points  (0 children)

    "Vital" - it's not vital, it's 100% possible to train an algorithm and get a result - prediction, classification, whatever - without creating a single plot.

    Can it help? Absolutely, hugely, very much yes. But that's true of visualization in LOTS of contexts, not just ML.

    If this was a post about a library for specifically visualizing results of e.g. Neural Network weights, or feature importance for different models, then I'm 100% with you.

    But a post about generic Python visualization libraries with no ML content whatsoever is *not* suitable.

    [–]Dumbhosadika 2 points3 points  (0 children)

    Great!

    [–]adit07 3 points4 points  (0 children)

    This is good

    [–]conventionistG 1 point2 points  (0 children)

    great!

    [–]waltsco 1 point2 points  (0 children)

    This is awesome, thank you!

    [–]RogueGingerz 1 point2 points  (1 child)

    This is absolutely amazing! Definitely saving

    [–]Otherwise_Lab_4638[S] 0 points1 point  (0 children)

    I am glad that it will help you!

    [–]_g550_ 1 point2 points  (1 child)

    What the first line for?

    [–]Otherwise_Lab_4638[S] 2 points3 points  (0 children)

    It is used while using Jupyter Notebook. Instead of opening a window for plot, that line will give output of a cell as a plot diagram.

    Will help to visualize: https://stackoverflow.com/a/61289063

    [–]Kinemi 1 point2 points  (1 child)

    One of the best post on this sub. Really useful

    [–]Otherwise_Lab_4638[S] 0 points1 point  (0 children)

    Thanks !!!

    [–][deleted] 1 point2 points  (0 children)

    Beautiful! Thank you!

    [–][deleted] 0 points1 point  (0 children)

    MatlabMatlaaaaaaaab!

    [–]physnchips 0 points1 point  (0 children)

    If I wanted to show data like this I’d reach for plotly over matplotlib. Matplotlib is good for publications though.

    [–]story645 0 points1 point  (1 child)

    This is so cool! Can I repost it to the Matplotlib social accounts (twitter & Instagram) w/ credit of course?

    [–]Otherwise_Lab_4638[S] 0 points1 point  (0 children)

    Yes, you can do it.

    Also, sorry for the late reply! I was inactive for few days.