我最近将一些绘图工作负载从 R 切换到 matplotlib。以我的拙见,我发现 matplotlib 的图表更漂亮(更好的默认颜色,它们看起来更清晰、更现代)。我还认为 matplotlib 渲染 PNG 效果要好得多。
不过,对我来说,真正的动机是我想在 Python(和 numpy)而不是 R 中处理我的底层数据。我认为这是一个大问题,你想用哪种语言来加载、解析和操作你的数据?数据?
另一方面,R 的一个好处是绘图默认值可以正常工作(一切都有一个函数)。我发现自己经常翻阅 matplotlib 文档(它们很厚),寻找一些晦涩的方法来调整边框或增加线条粗细。 R 的绘图例程有一定的成熟度。
This is a tough one to answer.
I recently switched some of my graphing workload from R to matplotlib. In my humble opinion, I find matplotlib's graphs to be prettier (better default colors, they look crisper and more modern). I also think matplotlib renders PNGs a whole lot better.
The real motivation for me though, was that I wanted to work with my underlying data in Python (and numpy) and not R. I think this is the big question to ask, in which language do you want to load, parse and manipulate your data?
On the other hand, a bonus for R is that the plotting defaults just work (there's a function for everything). I find myself frequently digging through the matplotlib docs (they are thick) looking for some obscure way to adjust a border or increase a line thickness. R's plotting routines have some maturity behind them.
I think that the largest advantage is that matplotlib is based on Python, which you say you already know. So, this is one language less to learn. Just spend the time mastering Python, and you'll benefit both directly for the plotting task at hand and indirectly for your other Python needs.
Besides, IMHO Python is an overall richer language than R, with far more libraries that can help for various tasks. You have to access data for plotting, and data comes in many forms. In whatever form it comes I'm sure Python has an efficient library for it.
And how about embedding those plots in more complete programs, say simple GUIs? matplotlib binds easily with Python's GUI libs (like PyQT) and you can make stuff that only your imagination limits.
发布评论
评论(2)
这是一个很难回答的问题。
我最近将一些绘图工作负载从 R 切换到 matplotlib。以我的拙见,我发现 matplotlib 的图表更漂亮(更好的默认颜色,它们看起来更清晰、更现代)。我还认为 matplotlib 渲染 PNG 效果要好得多。
不过,对我来说,真正的动机是我想在 Python(和 numpy)而不是 R 中处理我的底层数据。我认为这是一个大问题,你想用哪种语言来加载、解析和操作你的数据?数据?
另一方面,R 的一个好处是绘图默认值可以正常工作(一切都有一个函数)。我发现自己经常翻阅 matplotlib 文档(它们很厚),寻找一些晦涩的方法来调整边框或增加线条粗细。 R 的绘图例程有一定的成熟度。
This is a tough one to answer.
I recently switched some of my graphing workload from R to matplotlib. In my humble opinion, I find matplotlib's graphs to be prettier (better default colors, they look crisper and more modern). I also think matplotlib renders PNGs a whole lot better.
The real motivation for me though, was that I wanted to work with my underlying data in Python (and numpy) and not R. I think this is the big question to ask, in which language do you want to load, parse and manipulate your data?
On the other hand, a bonus for R is that the plotting defaults just work (there's a function for everything). I find myself frequently digging through the matplotlib docs (they are thick) looking for some obscure way to adjust a border or increase a line thickness. R's plotting routines have some maturity behind them.
我认为最大的优点是matplotlib是基于Python的,你说你已经知道了。所以,这是一种少学的语言。只需花时间掌握 Python,您将直接受益于手头的绘图任务,并间接受益于您的其他 Python 需求。
此外,恕我直言,Python 总体上是一种比 R 更丰富的语言,拥有更多的库可以帮助完成各种任务。您必须访问数据才能绘图,而数据有多种形式。无论它以何种形式出现,我确信 Python 都有一个高效的库。
那么如何将这些绘图嵌入到更完整的程序(例如简单的 GUI)中呢? matplotlib 可以轻松地与 Python 的 GUI 库(如 PyQT)绑定,您可以制作只有您的想象力所限制的东西。
I think that the largest advantage is that matplotlib is based on Python, which you say you already know. So, this is one language less to learn. Just spend the time mastering Python, and you'll benefit both directly for the plotting task at hand and indirectly for your other Python needs.
Besides, IMHO Python is an overall richer language than R, with far more libraries that can help for various tasks. You have to access data for plotting, and data comes in many forms. In whatever form it comes I'm sure Python has an efficient library for it.
And how about embedding those plots in more complete programs, say simple GUIs? matplotlib binds easily with Python's GUI libs (like PyQT) and you can make stuff that only your imagination limits.