Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Personally I find the style and whitespace defaults in matplotlib to be surprisingly displeasing. It always looks like "I just threw this together—I'll fix it later." Sure, you can fix it, but it's a huge fight.

PyX is a much better alternative. Like TeX, everything you make looks great.

edit for links:

https://pyx-project.org/examples/graphs/index.html

https://sourceforge.net/p/pyx/gallery/index/



The "I'll fix it later" aesthetic of matplotlib is addressed well by seaborn [1], which is built on top of matplotlib. Seaborn also works gracefully with Pandas. The killer feature for me of seaborn is "sns.despine()".

PyX is new to me, but it looks like it hasn't been updated in a while [2, 3].

[1] https://seaborn.pydata.org

[2] https://pyx-project.org/news.html

[3] https://github.com/pyx-project/pyx


+1 on Seaborn. I'd never make anything for outside consumption direct from matplotlib. If I need it done quickly, Seaborn looks professional.


but, drags in pandas.


Even standalone (feeding numpy arrays), I found it choking when going past 30k points in certain scenarios (2d heatmaps IIRC).


Is matplotlib (sans seaborn) performant in this scenario?


Oh seaborn does look like an improvement.

Honestly there is no need to update it because it is already perfect. It is like TeX in that way.

However there is some missing stuff like contour plots.


Matplotlib is definitely a monolith, and it does seem like a huge fight to fix the style, but what is great is you can easily use some of its several predefined styles [0], define your own style sheets or customize specific style parameters through rcParams [1], or install third-party style sheets [2], so in the end the styling does seem much more manageable.

[0]: https://matplotlib.org/stable/gallery/style_sheets/style_she...

[1]: https://matplotlib.org/stable/tutorials/introductory/customi...

[2]: https://pythonawesome.com/matplotlib-style-for-scientific-pu...


Python is my daily driver, but I briefly experimented with R and had a delightful experience with ggplot2. The ‘grammar of graphics’ was hard to leave behind when I switched back to Python, until I heard about Plotnine [1], which brings much of the same grammar and functionality to Python. It’s built on Matplotlib and a few other common libraries like Pandas.

[1] https://plotnine.readthedocs.io/en/stable/


Is there any way to do hextri plots with this? That has been one plot that is sorely needed in python for showing multiclass jointplots.


I don't think any package outside of one particular R one offers that functionality premade, as it's not a particularly common configuration.


There are built-in styles. Personally, i find plt.style.use(‘ggplot’) at the top of my scripts to make a big difference.


The PyX's github repo [0] shows fairly low activity recently. The last commit was on November 21, 2021 (almost a year ago). I am curious whether PyX is in a maintenance mode?

[0] https://github.com/pyx-project/pyx


As a PyX user for 17 years it's more that the software is complete and does everything most people need perfectly.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: