Standard MassMutual visualization theme built for matplotlib.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mmviz
.gitignore
README.md
requirements.txt
setup.py

README.md

Introduction

Standard MassMutual visualization theme built for matplotlib.

Styles Installation

cd {path_to_project}/mmviz-python
python install.py

Example

matplotlib.style.use("mmviz")
mmviz.scale_fill_mm()

df = pd.read_csv("../data/diamonds.csv")
df1 = df.groupby('clarity').size()
df1.sort_values(ascending=False, inplace=True)

ax = df1.plot.bar(rot=0)
ax.set_title("Diamonds by Clarity")
mmviz.theme_mm(ax, "bar")

plt.xlabel("Clarity")
plt.ylabel("Frequency")

plt.show()

Available Functions

[mmviz.py]

  • theme_mm(ax, chart_type = "default")
  • scale_color_mm(type = "qual")
  • scale_fill_mm(type="qual")
  • create_bin_list(values, binwidth)
  • place_legend(plt, title, width = 0.2)

Install mmviz in other projects

mmviz is published as a python package in artifactory. To install it, simply add the following index urls into the top of your requirements.txt for pip isntall


--index-url=https://pypi.python.org/simple
--extra-index-url=https://artifactory.m38.io/artifactory/api/pypi/pypi-local/simple/
mmviz==version_number_here