romerogroup / pyprocar

A Python library for electronic structure pre/post-processing
GNU General Public License v3.0
165 stars 72 forks source link

Please do not change my plotting parameters #58

Open aglinn opened 2 years ago

aglinn commented 2 years ago

Hi, I find your code to be very useful and plan to use it in my upcoming publication. However, I find one subtle detail to be quite annoying: you set a bunch of Matplotlib rcparams in your various imports; so, just importing PyProcar breaks my tediously and perfectly formatted figures. I am trying to add a couple of PyProcar plots as subplots to another plot, and I do not want your plot parameters. I want mine. In principle, I can of course overwrite your changes to my plotting parameters, but I did not set every single Matplotlib rcparam manually; so, some were presumably defaults, which you then changed unbeknownst to me. Then, tracking down which rcparam was changed and what the previous default was is a bit of a pain, since there are a lot of them.

For me, the easiest solution to the problem was finding your package in my environment directory, opening it in pycharm, using the "find in path" option found by right clicking on the entire project directory and searching for "plot.rc", and finally deleting all of the lines where the plt.rcParams and similar commands are called. Not too bad once you realize the cause of the change in the figure formatting, which is what took quite a bit of time.

Anyway, sorry to gripe, but I think you should consider 1) not changing plotting parameters to begin with or 2) give a flag somewhere to either use your plotting parameters or not to make it easy to not use them.