Windows10のHyper-Vでubuntu18.04の拡張セッションモードで接続

www.youtube.com

ずっとエラーできなかったのですがこの動画を見て自動ログインにしているとだめなようです。

自動ログインを解除すると使えるようになりました。

f:id:imabari_ehime:20181020204307p:plain

あとはHyper-Vの設定の拡張セッションモードを許可するにチェックを確認

matplotlibの書き方

qiita.com

qiita.com

teratail.com

matplotlibのAPIを使う1

plt.figure(figsize=(12, 4))
plt.plot(df['DATE TIME'], df['D0'])
plt.ylabel('P')
plt.xlabel('Time')

matplotlibのAPIを使う2

fig = plt.figure(figsize=(12, 4))
ax1 = fig.add_subplot(111)
ax1.plot(df['DATE TIME'], df['D0'])
ax1.set_ylabel('P')
ax1.set_xlabel('Time')

DataFrameのAPIをを使う

ax = df.plot(x='DATE TIME', y='D0',figsize=(4, 4))
ax.set_ylabel('P')
ax.set_xlabel('Time')

matplotlibを使う場合、plot() には列データを渡しますが、 DataFrame.plot() の場合は Label名を渡すことに注意してください

pylab.yticks(range(0,110,10), range(0,110,10)) # Y軸の目盛りを10刻みにする pylab.ylim(0,100) # Yの範囲を指定

Colaboratoryでグラフの日本語表示

インストール

!apt install fonts-ipafont-gothic
!rm /root/.cache/matplotlib/fontList.json

使用時

import pandas as pd
import matplotlib.pyplot as plt

plt.rcParams['font.family'] = 'IPAPGothic'

# seaborn利用時
import seaborn as sns

sns.set(font=['IPAPGothic'], font_scale=1.2, style='whitegrid',rc= {'legend.frameon': True})
名前 背景 グリッド
darkgrid グレー あり
dark グレー なし
whitegrid ホワイト あり
white ホワイト なし
ticks ホワイト 軸にのみ