Contents

matplotlib 3.9.2

0

Python plotting package

Python plotting package

Stars: 20107, Watchers: 20107, Forks: 7601, Open Issues: 1590

The matplotlib/matplotlib repo was created 13 years ago and the last code push was Yesterday.
The project is extremely popular with a mindblowing 20107 github stars!

How to Install matplotlib

You can install matplotlib using pip

pip install matplotlib

or add it to a project with poetry

poetry add matplotlib

Package Details

Author
John D. Hunter, Michael Droettboom
License
License agreement for matplotlib versions 1.3.0 and later ========================================================= 1. This LICENSE AGREEMENT is between the Matplotlib Development Team ("MDT"), and the Individual or Organization ("Licensee") accessing and otherwise using matplotlib software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, MDT hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib alone or in any derivative version, provided, however, that MDT's License Agreement and MDT's notice of copyright, i.e., "Copyright (c) 2012- Matplotlib Development Team; All Rights Reserved" are retained in matplotlib alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib . 4. MDT is making matplotlib available to Licensee on an "AS IS" basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB , OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between MDT and Licensee. This License Agreement does not grant permission to use MDT trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using matplotlib , Licensee agrees to be bound by the terms and conditions of this License Agreement. License agreement for matplotlib versions prior to 1.3.0 ======================================================== 1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the Individual or Organization ("Licensee") accessing and otherwise using matplotlib software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, JDH hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use matplotlib alone or in any derivative version, provided, however, that JDH's License Agreement and JDH's notice of copyright, i.e., "Copyright (c) 2002-2011 John D. Hunter; All Rights Reserved" are retained in matplotlib alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates matplotlib or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to matplotlib. 4. JDH is making matplotlib available to Licensee on an "AS IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING MATPLOTLIB , OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between JDH and Licensee. This License Agreement does not grant permission to use JDH trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using matplotlib, Licensee agrees to be bound by the terms and conditions of this License Agreement.
Homepage
None
PyPi:
https://pypi.org/project/matplotlib/
Documentation:
https://matplotlib.org
GitHub Repo:
https://github.com/matplotlib/matplotlib

Classifiers

  • Scientific/Engineering/Visualization
No  matplotlib  pypi packages just yet.

Errors

A list of common matplotlib errors.

Code Examples

Here are some matplotlib code examples and snippets.

  • ta code examples

    This python code example will show you how to use the ta python package to perform technical analysis on historical stock data such as RSI, SMA, Bollinger Bands, and Stochastic Oscillator.

  • Plot 3 different Pandas Dataframes in the same chart

    import pandas as pd
    import numpy as np
    from matplotlib import pyplot as plt
    
    #using numpy's randint to generate some data
    df1 = pd.DataFrame(np.random.randint(0,100,size=(10, 2)), columns=list('XY'))
    df2 = pd.DataFrame(np.random.randint(0,100,size=(10, 2)), columns=list('XY'))
    df3 = pd.DataFrame(np.random.randint(0,100,size=(10, 2)), columns=list('XY'))
    
    df1.head(), df2.head(), df3.head()
    
    (    X   Y
     0  82  32
     1  79  13
     2  87  19
     3   6  73
     4   1  38,
         X   Y
     0  47  62
     1  41   0
     2  98  78
     3  63  83
     4  31  59,
         X   Y
     0  57  25
     1  49  27
     2   9  29
     3  93  75
     4  23  80)
    
    # Get handle of first figure to pass to other plot() calls as ax
    ax =  df1.plot(color="red", figsize=(10,5))
    df2.plot(ax=ax, color="orange", figsize=(10,5))
    df3.plot(ax=ax, color="green", figsize=(10,5))
    
    # Note: subsequent plots need to happen in the same notebook cell.
    
    <AxesSubplot:>
    

    /code/multiple-dataframes-plot-same-chart/pandas.plot()-multiple-dataframes.png

  • Use pandas and matplotlib to produce a chart of natural gas prices

    In this example Python code, we use requests to fetch data from the EIA.gov website and json from the Python standard library to parse the json data. Next, we load the daily prices into a Pandas DataFrame and format the date column and set it as the index. Finally, we use Pandas .plot() to create a chart saving it as a png image.

GitHub Issues

The matplotlib package has 1590 open issues on GitHub

  • Replace sole use of maxdict by lru_cache.
  • Backport PR #22077 on branch v3.5.x (Fix keyboard event routing in Tk backend (fixes #13484, #14081, and #22028))
  • Backport PR #22290 on branch v3.5.x (Respect position and group argument in Tk toolmanager add_toolitem)
  • Backport PR #22279 on branch v3.5.x (Remove Axes sublists from docs)
  • Backport PR #22293 on branch v3.5.x (Modify example for x-axis tick labels at the top)
  • Arbitrary toolbar customization hooks.
  • More standardization of floating point slop in mpl_toolkits.
  • Add a helper to generate xy coordinates for AxisArtistHelper.
  • Fix colorbar exponents
  • [Bug]: Wrong position of exponent label for extended colorbar
  • [Bug] set_3d_properties type error in Matplotlib 3.5.1
  • Added tests for ContourSet.legend_elements
  • [Bug]: Args for tripcolor
  • MNT: Deprecate cbook.maxdict
  • MNT: Remove cmap_d colormap access

See more issues on GitHub

Related Packages & Articles

keras 3.6.0

Keras is a deep learning API written in Python, running on top of the machine learning platform TensorFlow. The core data structures of Keras are layers and models. The philosophy is to keep simple things simple, while allowing the user to be fully in control when they need to (the ultimate control being the easy extensibility of the source code via subclassing).

gensim 4.3.3

Python framework for fast Vector Space Modelling