Feel free to read the code on GitHub
paltes: https://matplotlib.org/examples/color/colormaps_reference.html cmaps = [(‘Perceptually Uniform Sequential’, [ ‘viridis’, ‘plasma’, ‘inferno’, ‘magma’]), (‘Sequential’, [ ‘Greys’, ‘Purples’, ‘Blues’, ‘Greens’, ‘Oranges’, ‘Reds’, ‘YlOrBr’, ‘YlOrRd’, ‘OrRd’, ‘PuRd’, ‘RdPu’, ‘BuPu’, ‘GnBu’, ‘PuBu’, ‘YlGnBu’, ‘PuBuGn’, ‘BuGn’, ‘YlGn’]), (‘Sequential (2)’, [ ‘binary’, ‘gist_yarg’, ‘gist_gray’, ‘gray’, ‘bone’, ‘pink’, ‘spring’, ‘summer’, ‘autumn’, ‘winter’, ‘cool’, ‘Wistia’, ‘hot’, ‘afmhot’, ‘gist_heat’, ‘copper’]), (‘Diverging’, [ ‘PiYG’, ‘PRGn’, ‘BrBG’, ‘PuOr’, ‘RdGy’, ‘RdBu’, ‘RdYlBu’, ‘RdYlGn’, ‘Spectral’, ‘coolwarm’, ‘bwr’, ‘seismic’]), (‘Qualitative’, [ ‘Pastel1’, ‘Pastel2’, ‘Paired’, ‘Accent’, ‘Dark2’, ‘Set1’, ‘Set2’, ‘Set3’, ‘tab10’, ‘tab20’, ‘tab20b’, ‘tab20c’]), (‘Miscellaneous’, [ ‘flag’, ‘prism’, ‘ocean’, ‘gist_earth’, ‘terrain’, ‘gist_stern’, ‘gnuplot’, ‘gnuplot2’, ‘CMRmap’, ‘cubehelix’, ‘brg’, ‘hsv’, ‘gist_rainbow’, ‘rainbow’, ‘jet’, ‘nipy_spectral’, ‘gist_ncar’])]
import matplotlib as mpl
import calmap
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('c:/1/yahoo.txt', parse_dates=['date'])
df.set_index('date', inplace=True)
df.head(3)
plt.figure(figsize=(16,10), dpi= 280)
calmap.calendarplot(df['2014']['VIX.Close'],cmap= 'seismic', fig_kws={'figsize': (16,10)}, yearlabel_kws={'color':'black', 'fontsize':24}, subplot_kws={'title':'Yahoo Stock Prices'})
plt.show()
df.head(4)
phone_data
df2.set_index('date', inplace=True)
df2.head()
plt.figure(figsize=(16,10), dpi= 280)
calmap.calendarplot(df2['2014']['duration'],cmap= 'BrBG', how='sum'
,fillcolor='white'
, fig_kws={'figsize': (16,10)}
, yearlabel_kws={'color':'black', 'fontsize':24}
, subplot_kws={'title':'phone_data'})
plt.show()
df3 = pd.read_csv('c:/2/Energy.csv', index_col=0, parse_dates=['Date'])
df3.set_index('Date', inplace=True)
df3.head()
plt.figure(figsize=(116,100), dpi= 280)
calmap.calendarplot(df3['2007']['Consumption'],cmap= 'YlOrBr', how='sum'
,fillcolor='white'
, fig_kws={'figsize': (16,10)}
, yearlabel_kws={'color':'gray', 'fontsize':44,'alpha':0.5}
, subplot_kws={'title':'Daily power consumption'})
calmap.calendarplot(df3['2008']['Consumption'],cmap= 'YlOrBr', how='sum'
,fillcolor='white'
, fig_kws={'figsize': (16,10)}
, yearlabel_kws={'color':'gray', 'fontsize':44,'alpha':0.5}
, subplot_kws={'title':'Daily power consumption'})
calmap.calendarplot(df3['2009']['Consumption'],cmap= 'YlOrBr', how='sum'
,fillcolor='white', daylabels='PWŚCPSN'
, fig_kws={'figsize': (16,10)}
, yearlabel_kws={'color':'gray', 'fontsize':44,'alpha':0.5}
, subplot_kws={'title':'Daily power consumption'})
df4 = pd.read_excel('c:/3/wtm.xlsx', parse_dates=['Date'])
df4.set_index('Date', inplace=True)
df4.head()
calmap.calendarplot(df4['2018']['Continuous'],cmap= 'YlGn', how='sum'
,fillcolor='white'
, fig_kws={'figsize': (16,10)}
, yearlabel_kws={'color':'gray', 'fontsize':44,'alpha':0.5}
, subplot_kws={'title':'Personal calendar'})
calmap.calendarplot(df4['2019']['Continuous'],cmap= 'YlGn', how='sum'
,fillcolor='white'
, fig_kws={'figsize': (16,10)}
, yearlabel_kws={'color':'gray', 'fontsize':44,'alpha':0.5}
, subplot_kws={'title':'Personal calendar'})