Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post/matplotlib_better_code/ #10

Open
utterances-bot opened this issue Sep 26, 2022 · 7 comments
Open

post/matplotlib_better_code/ #10

utterances-bot opened this issue Sep 26, 2022 · 7 comments

Comments

@utterances-bot
Copy link

编写科研作图代码有更好的方法 - 炸鸡人博客

A minimal Hugo theme with nice theme color.

https://zhajiman.github.io/post/matplotlib_better_code/

Copy link

大受启发,不知道大佬能不能多分享一些Python作图或者处理数据模块化技巧,正在逐步学习你的方法

Copy link

BUUJUN commented Sep 26, 2022

最后一段写的太有道理了!牛!

Copy link
Owner

这篇仅仅是搬运翻译,对这种方法感兴趣的话可以看看原作者博客里的代码。并且我也对这种方法抱有疑问:定义一些没有参数,变量要到全局去找的函数总让我感觉有点不舒服;而如果把函数定义得太详尽,在后续的修改过程中又必须来来回回修改。

Copy link

BUUJUN commented Sep 26, 2022

确实,有时候追求函数的完美反而要花费更多的时间,但是函数确实能让我的代码结构更加清晰

Copy link

Syize commented Oct 17, 2022

是这样的,必要的函数封装能够大大方便后续的使用。不过对于大一点的代码而言有时需要定义很多的函数,反而增加了不少工作量。这个时候可以考虑写一个类来处理了

Copy link

ghost commented Dec 21, 2022

1,1b,2,2b,3,3b 非常真实。
Proplot 直接将一些常用的方法封装起来或许可以稍稍减轻这种痛苦。
总的来说,模块化和灵活调试一般不可同取。建议在探索时“意识流”,成果有价值再考虑模块化。

Copy link

有大佬搞地理真的是幸事

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants