광범위한 플로팅 스크립트의 경우 matplotlibs rcParams를 사용하여 팬더 DataFrames의 표준 플롯 설정을 구성합니다.팬더 데이터 프레임 플롯 : 기본 색상 맵 영구 변경
이
here가 여기 내 현재의 접근 방식 설명 기본 컬러 맵에 대한 색상과 글꼴 크기 잘 작동하지만 (첫 번째 플롯은 색상 맵을 통해 색상 맵을 사용하지 않는
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm
# global plotting options
plt.rcParams.update(plt.rcParamsDefault)
matplotlib.style.use('ggplot')
plt.rcParams['lines.linewidth'] = 2.5
plt.rcParams['axes.facecolor'] = 'silver'
plt.rcParams['xtick.color'] = 'k'
plt.rcParams['ytick.color'] = 'k'
plt.rcParams['text.color'] = 'k'
plt.rcParams['axes.labelcolor'] = 'k'
plt.rcParams.update({'font.size': 10})
plt.rcParams['image.cmap'] = 'Blues' # this doesn't show any effect
# dataframe with random data
df = pd.DataFrame(np.random.rand(10, 3))
# this shows the standard colormap
df.plot(kind='bar')
plt.show()
# this shows the right colormap
df.plot(kind='bar', cmap=cm.get_cmap('Blues'))
plt.show()
을 그것은 단지 내가 두 번째 플롯과 같이 인수로 전달하면 작동합니다
,팬더 DataFrame 플롯에 대한 표준 색상 맵을 영구히 정의 할 수있는 방법이 있습니까?
미리 감사드립니다.