GithubHelp home page GithubHelp logo

chloeann95 / bg-mpl-stylesheets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from billingegroup/bg-mpl-stylesheets

0.0 0.0 0.0 588 KB

Matplotlib style sheets

License: MIT License

Python 83.40% Xonsh 16.60%

bg-mpl-stylesheets's Introduction

BillingeGroup mpl-stylesheets

  • matplotlib can accept a manually defined stylesheet file that is located remotely or locally.

  • To use the BillingeGroup stylesheet, please install this package first

    1. It is recommended to install using conda: conda install -c conda-forge bg-mpl-stylesheets

    2. Else, you can install from source code in this repo by python setup.py install.

  • By default the package uses LaTeX fonts for mathematical symbols. This feature requires a Latex package on your computer. It is not required for the use of the styel-sheet but gives better results for things like angstrom symbols.

    apt-get install dvipng texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-fonts-recommended cm-super
    
  • Then simply place the following commands at the begining of you python session whenever you plot.

    import matplotlib.pyplot as plt
    from bg_mpl_stylesheet.bg_mpl_stylesheet import bg_mpl_style
    plt.style.use(bg_mpl_style)
    
  • If you wish to use BillingeGroup stylesheet as the default style of your plots, please follow these steps.

    1. Use following commands to figure out which matplotlib config directory on your system:

      import matplotlib
      config_dir = matplotlib.get_configdir()
      
    2. Copy and paste bg_mpl_stylesheet file to the config_dir found at previous step.

    • NOTE: If you installed bg-mpl-stylesheets via conda, or do not have the bg_mpl_stylesheet file for any other reason, you can (re)download it here.
  • You could also configure any matplotlib rcParameter dynamically in your python session by

    plt.rcParams['figure.dpi'] = 180
    plt.rcParams['font.size'] = 18
    (... and so on)
    
  • Now you can start writing the plot codes as normal, such as

    import matplotlib.pyplot as plt
    plt.plot([1, 2, 3, 4])
    plt.ylabel('some numbers')
    plt.show()
    
  • You can also go to the example folder and run plot.py for testing. The example plot would be like this:

example_plot

  • The full group color cycle is shown in the following along with the color codes:

color_cycle

bg-mpl-stylesheets's People

Contributors

chiahaoliu avatar cj-wright avatar connorjbracy avatar dragonyanglong avatar mkwang2024 avatar pliu2781 avatar sbillinge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.