Saravanan666/pypi-org huggingface dataset:
Package: matplotlibhelper
Matplotlib HelperMatplotlib Helper is my custom helper to tune Matplotlib experience forPandoctools/Knitty(but it can be used by itself). I tuned fonts (that are shipped with this python package), please see default fonts and other options in default keyword arguments ofready(...),img(...)andimg_path(...). I made some tweaks to use it withSugarTeX, some tweaks to automatically use interactive Qt5 plots in Atom/Hydrogen or non-jupyter Python. It can also export plots to SVG or PNG.Works in Jupyter as well.ContentsMatplotlib HelperContentsInstallUsage exampleHintsInstallVia conda:conda install -c defaults -c conda-forge matplotlibhelperVia pip:pip install matplotlibhelperAdditionally you may need to install to use in Jupyter Lab:conda install jupyterlab jupyterlab_server tk nodejs
pip install ipympl
jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlibInstead ofpip install ipymplyou can also try:conda update --all
conda install -c defaults -c conda-forge ipympl
conda update --allUsage exampleUsage example that works both in Atom+Hydrogen and in Pandoctools+Knitty:importIPython.displayasdsimportmatplotlibhelperasmhmh.ready(font_size=14)# should be run before import matplotlib.pyplotimportmatplotlib.pyplotaspltplt.figure(figsize=mh.figsize(w=6))# height is automatic via the golden rationplt.plot([1,2,3,4])plt.ylabel(mh.stex('ˎ∇ ⋅ [ ⃗E]ˎ, V/m'))# using SugarTeX# this code in Knitty would be parsed by Pandoc,# in Atom/Hydrogen or Jupyter it would be displayed:ds.display(ds.Markdown(f'![My beautiful figure]({mh.img()}){{#fig:1}}'))# or if you have image size issues in Hydrogen try:ds.display(ds.HTML(f'<img src="{mh.img()}" width="900">'))Qt backend givesinteractive plots in Atom/Hydrogen.HintsDeletefontList.cache,fontList.py3k.cacheorfontList.jsonfrom%USERPROFILE%\.matplotlibfolder after installing a new font.If font becomes bold without a reason try (source):frommatplotlibimportfont_managerif'roman'infont_manager.weight_dict:delfont_manager.weight_dict['roman']# noinspection PyProtectedMemberfont_manager._rebuild()InstallComputer Modern Unicodefor bold-italic unicode support:"mathtext.sf": "CMU Serif:bold:italic". Sans-serif command\mathsf{}is reassigned because sans-serif font is rarely used in serif docs.
Package: matplotlib-inline
Matplotlib Inline Back-end for IPython and JupyterThis package provides support for matplotlib to display figures directly inline in the Jupyter notebook and related clients, as shown below.InstallationWith conda:condainstall-cconda-forgematplotlib-inlineWith pip:pipinstallmatplotlib-inlineUsageNote that in current versions of JupyterLab and Jupyter Notebook, the explicit use of the%matplotlib inlinedirective is not needed anymore, though other third-party clients may still require it.This will produce a figure immediately below:%matplotlibinlineimportmatplotlib.pyplotaspltimportnumpyasnpx=np.linspace(0,3*np.pi,500)plt.plot(x,np.sin(x**2))plt.title('A simple chirp');LicenseLicensed under the terms of the BSD 3-Clause License, by the IPython Development Team (seeLICENSEfile).BSD 3-Clause LicenseCopyright (c) 2019-2022, IPython Development Team.
All rights reserved.Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package: matplotlib-inline-labels
matplotlib_inline_labelsThis package is inspired bymatplotlib-label-linesIt adds automatic label positioning by preventing label bounding boxes from overlapping other lines and each other.InstallJust do:pipinstallmatplotlib-inline-labelsExampleimportnumpyasnpfrommatplotlibimportpyplotaspltfromscipy.statsimportchi2,loglaplacefrominline_labelsimportadd_inline_labelsX=np.linspace(0,1,500)A=[1,2,5,10,20]funcs=[np.arctan,np.sin,loglaplace(4).pdf,chi2(5).pdf]fig,axes=plt.subplots(ncols=2,nrows=3,constrained_layout=True,figsize=(8,8))axes=axes.flatten()forainA:axes[0].plot(X,np.arctan(a*X),label=f"Line{a}")add_inline_labels(axes[0],with_overall_progress=True,fontsize="large")forainA:axes[1].plot(X,np.sin(a*X),label=f"Line{a}")axes[2].plot(X,loglaplace(4).pdf(a*X),label=f"Line{a}")axes[3].plot(X,chi2(5).pdf(a*X),label=f"Line{a}")axes[4].semilogx(X,np.arctan(5*a*X),label=str(a))axes[5].semilogx(X,chi2(5).pdf(a*X),label=str(a))add_inline_labels(axes[1],with_overall_progress=True,fontsize="x-small")add_inline_labels(axes[2],with_overall_progress=True,fontsize="medium")add_inline_labels(axes[3],with_overall_progress=True,fontsize="medium")add_inline_labels(axes[4],with_overall_progress=True,fontsize="small")add_inline_labels(axes[5],with_overall_progress=True,fontsize="small")fig.show()Visual debugIf something goes wrong or the automatic placement could be enhanced, a visual debug is available:fig,ax=plt.subplots()forainA:ax.semilogx(X,chi2(5).pdf(a*X),label=f"Line{a}")ax.set_ylim(top=0.12)fig_debug=add_inline_labels(ax,ppf=1.5,with_perlabel_progress=True,debug=True)fig_debug.show()TODOMake it work for line with error barsHandle the case of axis lims or scale modification after adding inline labelsCreate an option to search label's position keeping the label's bounding box sides intersecting the curve in their centersAvoid Line2D labels to overlap non Line2D objects -> Needs to build geometries for other objects
Package: matplotlib-label-lines
matplotlib-label-linesEasily label line(s) using matplotlib.The code is heavily based onhttp://stackoverflow.com/questions/16992038/inline-labels-in-matplotlib(original code from NauticalMile).InstallJust do:pipinstallmatplotlib-label-linesYou can try it online on binder, get some inspiration fromthe exampleor from the following script:importnumpyasnpfrommatplotlibimportpyplotaspltfromscipy.statsimportchi2,loglaplacefromlabellinesimportlabelLine,labelLinesX=np.linspace(0,1,500)A=[1,2,5,10,20]funcs=[np.arctan,np.sin,loglaplace(4).pdf,chi2(5).pdf]fig,axes=plt.subplots(ncols=2,nrows=3,constrained_layout=True,figsize=(8,8))axes=axes.flatten()ax=axes[0]forainA:ax.plot(X,np.arctan(a*X),label=str(a))labelLines(ax.get_lines(),zorder=2.5)ax=axes[1]forainA:ax.plot(X,np.sin(a*X),label=str(a))labelLines(ax.get_lines(),align=False,fontsize=14)ax=axes[2]forainA:ax.plot(X,loglaplace(4).pdf(a*X),label=str(a))xvals=[0.8,0.55,0.22,0.104,0.045]labelLines(ax.get_lines(),align=False,xvals=xvals,color="k")ax=axes[3]forainA:ax.plot(X,chi2(5).pdf(a*X),label=str(a))lines=ax.get_lines()l1=lines[-1]labelLine(l1,0.6,label=r"$Re=${}".format(l1.get_label()),ha="left",va="bottom",align=False,backgroundcolor="none",)labelLines(lines[:-1],yoffsets=0.01,align=False,backgroundcolor="none")# labelLines also supports log-scaled x-axesax=axes[4]forainA:ax.semilogx(X,np.arctan(5*a*X),label=str(a))labelLines(ax.get_lines(),zorder=2.5)ax=axes[5]forainA:ax.semilogx(X,chi2(5).pdf(a*X),label=str(a))labelLines(ax.get_lines(),xvals=(0.1,1),zorder=2.5)fig.show()CitingIf you're using this package for research purposes, consider citing theZenodo entry (https://zenodo.org/record/7428071).
Package: matplotlib-latex-bridge
matplotlib-latex-bridgeThis library provides a set of functions and shortcuts to create latex-ready images with matplotlib.This library is not a replacement for matplotlib, it can just be used to set sensible settings in order to have figures with readable text and with a font size that is consistent both among various figures and with the rest of the text in the document.Example:InstallThe latest stable version can be installed via pip:pip install matplotlib-latex-bridgeOtherwise, the library can be installed from sources:git clone https://github.com/loreucci/matplotlib-latex-bridge.git
cd matplotlib-latex-bridge
pip install -e .QuickstartInitialize the library using one of the presets provided:importmatplotlib_latex_bridgeasmlbmlb.setup_page(**mlb.formats.article_letterpaper_10pt_singlecolumn)Create a new figure and use it as normal:mlb.figure_textwidth()# for full page imagesmlb.figure_columnwidth()# for full column imagesplt.plot(...)# use matplotlib as normalfig.savefig("image.png")Include it in the latex file without scaling:\begin{figure}\centering\includegraphics[scale=1]{image.png}\end{figure}That's it!For more options please refer to theonline documentation.
Package: matplotlib-polyroi
matplotlib-polyroiModule for selecting polygonal ROIs on images, spline fitting and ROI expansionInstructionsAs a first step, I would recommend checking out thetutorial notebook. This can be run in the cloud using Binder (please note that it may take several minutes to open the notebook):To run locally, download the code and install the relevant requirements (requirements.txt) in a virtual environment.InstallationTo explore further and incorporate into your own analysis pipelines, you can install the package from PyPI using pip:pip install matplotlib-polyroiIf you want to make changes to the code you can download/clone this folder, navigate to it, and run:pip install -e .[dev]LicenseThis work is licensed under aCreative Commons Attribution 4.0 International License.
Package: matplotlib-pyodide
matplotlib-pyodideHTML5 backends for Matplotlib compatible with PyodideThis package includes two matplotlib backends,thewasm_backendwhich from allows rendering the Agg buffer as static images into an HTML canvasan interactive HTML5 canvas backendhtml5_canvas_backenddescribed inthis blog postInstallationThis package will be installed as a dependency when you loadmatplotlibin Pyodide.UsageTo change the backend in matplotlib,for the wasm backend,importmatplotlibmatplotlib.use("module://matplotlib_pyodide.wasm_backend")for the interactive HTML5 backend;importmatplotlibmatplotlib.use("module://matplotlib_pyodide.html5_canvas_backend")By default, matplotlib figures will be rendered inside a div that's appended to the end ofdocument.body.
You can override this behavior by settingdocument.pyodideMplTargetto an HTML element. If you had an HTML
element with id "target", you could configure the backend to render visualizations inside it with this code:document.pyodideMplTarget=document.getElementById('target')For more information see thematplotlib documentation.Licensepyodide-cli uses theMozilla Public License Version
2.0.
Package: matplotlibqml
A matplotlib mini backend always base on the latest QT for Python, no compatible will be careFocus on Qt 6 (will always point to the latest) for Python and QML/QWidget as main user case, only desktop application will be careMainly base on:1. https://github.com/jmitrevs/matplotlib_backend_qtquick
2. https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_qt5.py
3. https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_qt5agg.pyThe module can run as qml demo application itself, like:python-mmatplotlibqmlA standalone classic QWidget sample(pure QWidget) is provided too, like:python-mmatplotlibqml.widgetdemo你好WhyQT keep improving and changing, and compatibility will kill flexibility, especially when upstream not so stableCredit:1. https://github.com/fcollonval/matplotlib_qtquick_playground
2. https://github.com/jmitrevs/matplotlib_backend_qtquick
3. https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_qt5.py
4. https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_qt5agg.py
5. Some weekend play for fun self Python project
Package: matplotlibstyles
Styles and helper functions for matplotlibStyles and helper functions for matplotlib.The latex styles use xelatex as a backend.InstallationThis package was developed and used on Linux.It is available on the PyPI respository.
It can be installed by runningpip install matplotlibstylesIf you do not have root access and it does not automatically default to installing locally, the--userflag may be used.For more information on building and installing python packages, see the documentation from thePython Packaging Authority.
Package: matplotlib-subsets
Routines for plotting area-weighted diagrams of subsets and subsets of subsets.
This consistutes an extension to Venn diagrams in some sense (hierarchy), while a limitation
in another (subsets only).InstallationThe simplest way to install the package is viaeasy_installorpip:$ easy_install matplotlib-subsetsDependenciesnumpy,scipy,matplotlib.UsageThe package provides the function:treesets_rectangles.It takes a tree, where each node is defined as ((number-of-items-contained,
label, dictionary-of-plotting-attributes), [child nodes…]).For example:tree = ((120, '120', None), [
        ((50, 'A50', None), []),
        ((50, 'B50', None), [])
        ])

treesets_rectangles(tree)
plt.savefig('example_tree.pdf', bbox_inches='tight')
plt.close()Here, the node ‘120’ is of size 120. It has two subsets, ‘A50’ and ‘B50’, each of size 50.
No additional plotting attributes are given (e.g. the color of rectangles is chosen automatically).See alsoReport issues and submit fixes at Github:https://github.com/JohannesBuchner/matplotlib-subsets
Package: matplotlib-terminal
matplotlib-terminalMatplotlib backend to plot in terminal usingmatrach/img2unicodeThis is in proof of concept stage, so stay tuned!
The library is optimized for Gnome Terminal with Ubuntu Mono font.
Nevertheless'block'and'braille'renderers should work with most modern terminals.Install it with:$pipinstallmatplotlib-terminalTo speed ~10x up thebrailleandgammarenderers, install an optional dependency ofimg2unicode:$pipinstall'img2unicode[n2]'Usage:importmatplotlib_terminalimportmatplotlib.pyplotasplt# Or in short:# from matplotlib_terminal import pltplt.plot([0,1],[0,1])plt.plot([1,0],[0,1],lw=3)plt.scatter([0],[.5])plt.show()plt.show('gamma')# Use RendererGamma-fast/noblock from img2unicode rendererplt.show('block')# Use Renderer-fast/block from img2unicode, dual color!plt.show('braille')# Use RendererGamma-fast/braille from img2unicode rendererplt.close()Sample resultsGamma renderer:Block renderer:Braille renderer:TODOfigure out how to configure the lib in matplotlib-ish way (eg. rcParams)allow to specify figure size in terms of cells
Package: matplotlib-tufte
matplotlib-tuftematplotlib-tufte is a python module
to create Tufte-like plots with matplotlib.Inspiration is drawn fromEdward Tufte: The Visual Display of Quantitative Information.Requirementspython >= 3.7matplotlibExamplesSeeexamples/Basic.ipynbfor some small examples of tuftelike plots.UsageCreate your plots with matplotlib as usual.
Then, runtuftelike.adjustwith the x- and y-values of your plot to adjust it in-place.import matplotlib.pyplot as plt
import tuftelike

xs, ys = [1, 2, 3, 4], [1, 4, 2, 3]
plt.plot(xs, ys)

tuftelike.adjust(xs, ys)
plt.savefig("example.png")Tuftelike needs the x- and y-values because matplotlib does not store these internally.
The above code produces:.
Package: matplotlibXtns
This package contains various small extension functions for the matplotlib
including tools for the mpl_toolkits.basemap and cartopy packages,
if these are installed (optional).Installation:After downloading the source fromgithubinstall via pip, descending
into the top-level of the source tree
and launching:pip3 install .or to install in developers mode:pip3 install -e .Or install the latest release from PyPI:pip install matplotlibXtnsDocumentation:Documentation of this package can be found onreadthedocs.
Package: matplotlylib
The NutshellUse this package to render matplotlib figures in plotly. Simply stick a
one-liner in after you’ve created your mpl figure:fig_to_plotly(fig, username, api_key)That will open up a new browser window with your mpl figure rendererd in
plotly.AboutPlotlyis an online collaborative data analysis and graphing tool. The
matplotlylib package allows users to export matplotlib figures to plotly.
Plotly figures are shared, tracked, and edited all online and the data is
always accessible from the graph. The goal of this project is to offer users
a simple interface to send a matplotlib figure to plotly from Python:fig_to_plotly(fig, username, api_key)That’s it. Find out more, sign up, and start sharing by visiting us athttps://plot.ly.Install via pipAssuming you have already installed pip, you can simply enter the following
in a terminal program:$ pip install matplotlylibInstall via makeA makefile is included on the GitHub repo for this project that is not part
of the PyPI distribution. If you want to make changes to this code,
you’ll probably want to go this route.To get started you need to grab a copy of thematplotlylib repo. The
makefile included in this is all you need to get setup. Just do the following:$ make build
$ make installThe first instruction will grab mplexporter and move it into the matplotlylib
directory.The second instruction will install the matplotlylib package, which now has
mplexporter built into it.IPython notebookThe project page has an extensiveIPython notebookwith example usage.Or, have a look at ourplotly profile, where you can open and edit all of
the examples. If the NB is loading slowing, checkout our static site hosted
on GitHub page at:http://plotly.github.io/matplotlylib/.DetailsThe matplotlylib package requires the matplotlib and plotly Python packages.This package is based on the mplexporter framework for crawling and exporting
matplotlib images. mplexporter is bundled with the source distribution via
git submodule.Created by:Plotly,@plotlygraphs,matplotlylib@gmail.comLicense: MIT
Package: matplotobjlib
matplotobjlibThis module is a wrapper for matplotlib, that enables creating plots in an easier declarative, more object-oriented
format.All functions and types are importable directly frommatplotobjlib. The easiest way to get started is withmatplotoblib.draw(...). This function takes either a singleSuplotobject or a 2d sequence ofSubplots where each inner sequence represents a row. EachSubplotconsists of 1 or morePlotables, the most useful beingGraph.# examples/sin.py

from matplotobjlib import draw, Graph, SubPlot
import numpy as np

xs = np.arange(-2*np.pi, 2*np.pi, 0.01)
ys = np.sin(xs)
draw(SubPlot(Graph(xs, ys, plot_type="-"), x_label="x", y_label="sin(x)"), title="sin")# examples/trig.py

from matplotobjlib import draw, Graph, SubPlot
import numpy as np

xs = np.arange(-2*np.pi, 2*np.pi, 0.01)
draw(
    [
        [
            SubPlot(Graph(xs, np.sin(xs), plot_type="-"), x_label="x", y_label="sin(x)"),
            SubPlot(Graph(xs, np.cos(xs), plot_type="-"), x_label="x", y_label="cos(x)"),
        ],
        [
            SubPlot(Graph(xs, np.tan(xs), plot_type="-"), x_label="x", y_label="tan(x)"),
            SubPlot(Graph(xs, np.arcsin(xs), plot_type="-"), x_label="x", y_label="sin$^{-1}$(x)"),
        ]
    ],
    title="Trigonometry",
)Additionally, for more control over the window, it can be accessed as a tkinter widget throughTkFigure. Thedraw(...)function even uses this internally.# examples/widget.py

import tkinter as tk
import numpy as np
from matplotobjlib import Graph, SubPlot, TkFigure

ts = np.arange(0, 10, 0.01)
xs = [t * np.cos(t) for t in ts]
ys = [t * np.sin(t) for t in ts]

root = tk.Tk()
widget = TkFigure(
    root, [[SubPlot(Graph(xs, ys, plot_type="-"), x_label="t*cos(t)", y_label="t*sin(t)")]], title="examples/widget.py"
)
widget.pack(expand=tk.YES, fill=tk.BOTH)
root.mainloop()
Package: matplotsave
IntroA library of functions (just one at the moment) to streamline the saving
and exporting of matplotlib plots as images and whatnot.I wrote it because I was spending a lot of time creating and saving
plots in another project of mine and wanted to automate it.Usagefrom matplotsave import pltsave

xs = list(range(10))
ys = [i**2 for i in xs]
with pltsave("myplot.png") as (fig,ax):
    ax.plot(xs,ys)This will export the plot tomyplot.pngpainlessly after you are
given the chance to actually plot some data.Because thepltsavecontext manager returns the fig and ax objects
the entire matplotlib api is still accessible.
Package: matplotsoccer
matplotsoccerThis is a package to visualize soccer dataTo install it simplypip install matplotsoccerThe most important functions arePlotting a field withmatplotsoccer.field():Plotting a heatmap withmatplotsoccer.heatmap(matrix)Plotting soccer event stream data. Here is an example of five actions in the SPADL format (seehttps://github.com/ML-KULeuven/socceraction) leading up to Belgium's second goal against England in the third place play-off in the 2018 FIFA world cup.game_idperiod_idsecondsteamplayerstart_xstart_yend_xend_yactiontyperesultbodypart865722179BelgiumAxel Witsel37.144.853.848.2passsuccessfoot865722181BelgiumKevin De Bruyne53.848.270.642.2dribblesuccessfoot865722184BelgiumKevin De Bruyne70.642.287.449.1passsuccessfoot865722185BelgiumEden Hazard87.449.197.938.7dribblesuccessfoot865722187BelgiumEden Hazard97.938.710537.4shotsuccessfootHere is the phase visualized usingmatplotsoccer.actions()matplotsoccer.actions(
    location=actions[["start_x", "start_y", "end_x", "end_y"]],
    action_type=actions.type_name,
    team=actions.team_name,
    result= actions.result_name == "success",
    label=actions[["time_seconds", "type_name", "player_name", "team_name"]],
    labeltitle=["time","actiontype","player","team"],
    zoom=False
)(c) Tom Decroos 2019