\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Justin1209 (Justin1209)} \pdfinfo{ /Title (matplotlib.pdf) /Creator (Cheatography) /Author (Justin1209 (Justin1209)) /Subject (Matplotlib Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{32E825} \definecolor{LightBackground}{HTML}{F2FDF1} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Matplotlib Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Justin1209 (Justin1209)} via \textcolor{DarkBackground}{\uline{cheatography.com/101982/cs/21196/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Justin1209 (Justin1209) \\ \uline{cheatography.com/justin1209} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 22nd November, 2019.\\ Updated 13th January, 2020.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Import Library}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{from}} {\emph{matplotlib}} {\bf{import}} {\emph{pyplot}} {\bf{as}} {\emph{plt}}} \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Basic Line Plot}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\emph{x\_values}} \newline {\bf{days = {[}0, 1, 2, 3, 4, 5, 6{]}}} \newline {\emph{y\_values1}} \newline {\bf{money\_spent = {[}10, 12, 12, 10, 14, 22, 24{]}}} \newline {\emph{y\_values2}} \newline {\bf{money\_spent\_2 = {[}11, 14, 15, 15, 22, 21, 12{]}}} \newline \newline {\emph{assigend to one plot}} \newline {\bf{plt.plot(days, money\_spent)}} \newline {\bf{plt.plot(days, money\_spent\_2)}} \newline \newline plt.show()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Subplots}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# Create subplots}} \newline plt.subplot({\emph{rows}}, {\emph{columns}}, {\emph{index\_of\_subplot}}) \newline {\bf{\# Example}} \newline {\emph{\# First Subplot}} \newline plt.subplot(1, 2, 1) \newline plt.plot(x, y, color='green') \newline \newline {\emph{\# Second Subplot}} \newline plt.subplot(1, 2, 2) \newline plt.plot(x, y, color='steelblue') \newline \newline {\bf{\# Format Subplots}} \newline plt.subplots\_adjust({\emph{arguements}}) \newline {\emph{left, right, top, bottom}} {\bf{-margin}} \newline {\emph{wspace, hspace}} {\bf{horizontal/vertical margin between plots}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{The object that contains all subplots is called {\emph{figure}} \newline Always put specific Attributes (color, markers, ...) for a subplot directly under {\emph{plt.plot()}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Linestyles}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{plt.plot(x, y, {\bf{{\emph{style}}=" "}})} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Keywords to put in for {\bf{style}}:} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{} \tn % Row Count 2 (+ 0) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{color}}= {\emph{green}}, {\emph{\#AAAAAA}}} \tn % Row Count 3 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{linestyle}}= dotted: {\bf{:}}, dashed: {\bf{-{}-}} or {\bf{-.}}} \tn % Row Count 5 (+ 2) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{marker}}= {\emph{o}}, {\emph{*}}, {\emph{s}}, {\emph{x}}, {\emph{d}}, {\emph{h}}} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{linewidth}}= 1, 2, ...} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{alpha}}= 0.1 - 1} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{} \tn % Row Count 8 (+ 0) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Boilerplate Styles:} \tn % Row Count 9 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{plt.style.use{\emph{("fivethirtyeight")}}} \tn % Row Count 10 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{plt.style.use{\emph{("ggplot")}}} \tn % Row Count 11 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{plt.style.use{\emph{("seaborn")}}} \tn % Row Count 12 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{plt.style.use{\emph{("default")}}} \tn % Row Count 13 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Legends}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# Create Legend}} \newline plt.legend({[}"{\emph{first\_line}}", "{\emph{second\_line}}", {\emph{loc=}}{]}) \newline \newline {\bf{\# loc Numbercode}} \newline 1 upper left \newline 2 upper right \newline 3 lower left \newline 4 lower right \newline 5 right \newline 6 center left \newline 7 center right \newline 8 lower center \newline 9 upper center \newline 10 center} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{loc specifies the legends location (if not specified: finds "best" location)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Figures}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# Create Figure with custom size}} \newline plt.figure(figsize=({\emph{width, heigth}})) \newline plt.plot(x, y) \newline plt.savefig('tall\_and\_narrow.{\emph{png/ .svg/ .pdf}}')} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{When we're making lots of plots, it's easy to end up with {\bf{lines that have been plotted and not displayed.}} If we're not careful, these "forgotten" lines will show up in your new plots. In order to be sure that you don't have any stray lines, you can use the command {\bf{plt.close('all')}} to clear all existing plots before you plot a new one.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Modify Ticks}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# Specify subplot to modify}} \newline ax1 = plt.subplot({\emph{row}}, {\emph{column}}, {\emph{index}}) \newline {\bf{\# Attributes}} \newline ax1.set\_xticks({[}{\emph{1, 2, 4}}{]}) \newline ax1.set\_yticks({[}{\emph{0.1, 0.2, ...}}{]}) \newline \newline ax1.set\_xticklabels({[}"Jan", "Feb", "Apr"{]}, {\bf{rotation=30}}) \newline {\emph{\# {\bf{rotation=degrees}} rotates the labels}} \newline \newline ax1.set\_yticklabels({[}"10\%", "20\%", ...{]})} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{We have to do it this way, even if we only have one plot} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Axis and Labels}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{Zoom in or out of the plot:}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{plt.axis({\emph{x\_min}}, {\emph{x\_max}}, {\emph{y\_min}}, {\emph{y\_max}})} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{Labeling the Axes:}}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{plt.xlabel("{\emph{str }}")/ plt.ylabel() / plt.title()} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Add Text to Graph}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{plt.{\bf{text}}(x\_coord, y\_coord, "text");} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Simple Bar Chart}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{plt.bar(range(len(y\_values)), y\_values)}}} \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{We use {\bf{range(len(y\_values))}} to get a tick for each value we want to represent in the Bar Chart} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Scatter Plot}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{plt.scatter(x\_values, y\_values)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Side-By-Side Bars}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# We have to specifiy the location of each Dataset in the Plot using this pattern: }} \newline \newline n = ? \# {\emph{Number of specific dataset}} \newline t = ? \# {\emph{Number of datasets}} \newline d = ? \# {\emph{Number of sets of bars}} \newline w = 0.8 \# {\emph{Width of each bar}} \newline \newline x\_values1 = {[}t*element + w*n {\bf{for}} element {\bf{in}} range(d){]} \newline \newline {\bf{\# Get x\_values in the middle of both bars}} \newline middle\_x = {[} (a + b) / 2.0 for a, b in zip(x\_values1, x\_values2){]}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Stacked Bars}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# We use the keyword {\emph{bottom}} to do this}} \newline {\bf{\# The top bar will have {\emph{bottom}} set as height}} \newline \newline {\emph{\# First Bar}} \newline video\_game\_hours = {[}1, 2, 2, 1, 2{]} \newline plt.bar(range(len(video\_game\_hours)), \newline video\_game\_hours) \newline \newline {\emph{\# Second Bar}} \newline book\_hours = {[}2, 3, 4, 2, 1{]} \newline plt.bar(range(len(book\_hours)), \newline book\_hours, \newline {\bf{bottom}}=video\_game\_hours) \newline \newline {\bf{\# Get each bottom for 3+ bars}} \newline sport\_hours = \seqsplit{np.add(video\_game\_hours}, book\_hours)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{If we want to compare {\emph{"different sub-attributes from one attribute"}} we can use stacked bar charts. For example: \newline {\bf{Attribute:}} Entertainment hours \newline {\bf{Sub-Attributes:}} Gaming, Reading, ...} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Error Bars}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# Use the keyword {\emph{yerr}} to repersent the error range}} \newline \newline values = {[}10, 13, 11, 15, 20{]} \newline yerr = {[}1, 3, 0.5, 2, 4{]} \# singe value possible \newline plt.bar(y, x, {\bf{yerr}}=yerr, {\bf{capsize}}=10) \newline plt.show()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{If we want to present an uncertainty Range within a Bar Chart we can use Error Bars} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Fill Between (Line Plot)}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{x = range(3) \newline y = {[}10, 12, 13{]} \newline \newline {\bf{y\_lower}} = {[}8, 10, 11{]} \newline {\bf{y\_upper}} = {[}i + 2 {\bf{for}} i {\bf{in}} y\_values{]} \newline \newline {\bf{\# Calculate a \% deviation}} \newline {\bf{y\_lower\_bound}} = {[}element - (element * error\_in\_decimal) for element in original\_list\_of\_y\_values{]} \newline \newline {\bf{\#this is the shaded error}} \newline plt.fill\_between(x, {\bf{y\_lower, y\_upper, alpha}}=0.2) \newline \newline {\bf{\#this is the line itself}} \newline plt.plot(x, y) \newline \newline plt.show()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Returns a shaded are around the line} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Pie Chart}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{payment\_names = {[}"Card Swipe", "Cash", "Apple Pay", "Other"{]} \newline payment\_freqs = {[}270, 77, 32, 11{]} \newline \newline {\bf{\# Creating Pie Chart}} \newline plt.pie(payment\_freqs) \newline plt.axis('equal') \newline \newline {\bf{\# Two Methods for Labeling}} \newline {\emph{\# First Method}} \newline plt.legend(payment\_names) \newline {\emph{\# Second Method (directly when creating)}} \newline plt.pie(payment\_freqs, labels=payment\_names) \newline \newline {\bf{Show percentages of total in each slice:}} \newline plt.pie(payment\_freqs, labels=payment\_names, {\bf{autopct='\%0.1f\%\%'}}) \newline {\emph{\# autopct takes a string formatting instruction}} \newline {\emph{\# \%d\%\% -\textgreater{} round to decimal}} \newline \newline plt.show()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Histogram}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\bf{\# Create one Histogram}} \newline plt.hist(dataset, range=(0,100), {\bf{bins}}=20) \newline {\emph{\# Specifiy number of {\bf{bins}} (default = 10)}} \newline \newline {\bf{\# Create multiple Histograms}} \newline plt.hist(a, {\bf{alpha}}=0.5, {\bf{normed}}=True) \newline plt.hist(b, {\bf{histtype}}='step', {\bf{linewidth}}=2 {\bf{normed}}=True)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{\emph{\# Specify {\bf{alpha}} for opacity or use {\bf{histtype}} to draw just the outline}} \newline {\emph{\# Use {\bf{linewidth}} to specifiy the linewidth of the outline}} \newline {\emph{\# Use the keyword {\bf{normed}} to normalize the histograms}} \newline \newline {\bf{Normalize}} divides the x\_values by a constat such that the area under the curve sums to 1} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}