如何增加Jupyter笔记本情节的大小

Pap*_*nho 4 python jupyter-notebook

使用calmap包我创建了一个热图日历,但我想知道如何增加字体或图的大小.

import numpy as np; np.random.seed(sum(map(ord, 'calmap')))
import pandas as pd
import calmap

all_days = pd.date_range('1/15/2014', periods=700, freq='D')
days = np.random.choice(all_days, 500)
events = pd.Series(np.random.randn(len(days)), index=days)

calmap.yearplot(events, year=2015)
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Mat*_*ieu 8

基于文档

def yearplot(data, year=None, how='sum', vmin=None, vmax=None, cmap='Reds',
         fillcolor='whitesmoke', linewidth=1, linecolor=None,
         daylabels=calendar.day_abbr[:], dayticks=True,
         monthlabels=calendar.month_abbr[1:], monthticks=True, ax=None,
         **kwargs):
Run Code Online (Sandbox Code Playgroud)

有一个ax参数。它对应于必须在其上绘制图形的轴。首先创建一个具有所需大小的轴。

from matplotlib import pyplot as plt

f, ax = plt.subplots(1, 1, figsize = (15, 10))
calmap.yearplot(events, year=2015, ax=ax)
Run Code Online (Sandbox Code Playgroud)

编辑:对于字体大小,在轴上工作。像这样的东西:

for item in ([ax.title, ax.xaxis.label, ax.yaxis.label] +
         ax.get_xticklabels() + ax.get_yticklabels()):
    item.set_fontsize(20)
Run Code Online (Sandbox Code Playgroud)


Ind*_*der 8

这应该可以解决您的问题

import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"]=20,20
Run Code Online (Sandbox Code Playgroud)