News for hackers. Stuff that matters.
Re:Gnuplotlib: Non-Painful Plotting for NumPy by dheera on Thursday February 01, 2024 @01:48AM (#39213343)

    from matplotlib import pyplot as plt
WTF? Broken from right there. What's a plt? "o" key broken? Why didn't they just call it pyplot? Why not just

    import pyplot
    pyplot.plot(lambda x: math.sin(x))
    pyplot.plot(x=[0,1,2],y=[0,2,4])
Re:Gnuplotlib: Non-Painful Plotting for NumPy by krapht on Thursday February 01, 2024 @02:35AM (#39213597)
People who are making plots in the terminal don't want to type out the fully qualified library name. Majority of plots are written and read only once during data exploration and analysis time.
Re:Gnuplotlib: Non-Painful Plotting for NumPy by stargazer-3 on Thursday February 01, 2024 @05:37AM (#39214541)
The library is not forcing you to use plt as a shorthand. Nothing is stopping you from calling

from matplotlib import pyplot

pyplot.plot([0,1,2], [0,2,4])

Re:Gnuplotlib: Non-Painful Plotting for NumPy by dheera on Thursday February 01, 2024 @12:21PM (#39218456)
Yeah I know. It's just that they've created an ecosystem of "plt" and that makes me want to use the entire library less.
Re:Gnuplotlib: Non-Painful Plotting for NumPy by Izkata on Thursday February 01, 2024 @08:29AM (#39215692)
It's a convention of the math-heavy python libraries, numpy and pandas also often get imported as np and pd.