Editing the rc configuration file

The basic format of the file is in the form of option: value. For example, to keep the legend always on the right, we put:

legend.loc: right

Matplotlib provides massive configurability of plots, and there are several places to control the customization:

  • Global machine configuration file: Matplotlib is configured for each user using the global machine configuration file
  • User configuration file: A unique file for each user, where they can overwrite the global configuration file choosing their own settings (note that the user can execute a Matplotlib-related code anytime)
  • Configuration file in the current directory: The current script or program can be customized specifically by using this directory

This is particularly useful in situations when different programs have different needs, and using an external configuration file is better than hardcoding those settings in the code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.203.175