""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. This reference example shows all colormaps included with Matplotlib. Note that any colormap listed here can be reversed by appending "_r" (e.g., "pink_r"). These colormaps are divided into the following categories: Sequential: These colormaps are approximately monochromatic colormaps vary
seaborn.heatmap# seaborn.heatmap(data, *, vmin=None, vmax=None, cmap=None, center=None, robust=False, annot=None, fmt='.2g', annot_kws=None, linewidths=0, linecolor='white', cbar=True, cbar_kws=None, cbar_ax=None, square=False, xticklabels='auto', yticklabels='auto', mask=None, ax=None, **kwargs)# Plot rectangular data as a color-encoded matrix. This is an Axes-level function and will draw the hea
この記事は jupyter notebook Advent Calendar 2016 の12月13日の記事です。 qiita.com Jupyter Notebookを使う上で,この機能を知らない人を見つけたら教えてあげたくなるような小ネタをいくつか紹介します。 IPython.display.display Jupyter Notebook上でpandasのDataFrameを表示すると,HTMLのtable要素として見やすく表示してくれます。活用している方も多いかと思います。 df[df['f'] == 'C'] と df[df['f'] == 'T'] を表示したいのですが,Jupyter Notebookで表示されるのはそれぞれのセルで最後に評価されたものだけです。そのため,表示したいDataFrameごとにセルを分ける必要があります。 gist.github.com しかしなが
はじめに Qiitaの記事をJupyterで見たいとき、コピペでもいいですが、一括して変換できるようにプログラムを作ってみました。 Jupyter notebookからMarkdownへ まずは、Jupyter notebookからMarkdownへ変換してみましょう。 Jupyterの"File"メニューの"Download as"からもできますが、Pythonでやってみます。 以下のコードを"make_md.py"とし、下記のようにすると、結果を画面に表示します。 python make_md.py "ファイル名" "raw"の場合、preタグで囲んでいます。 "code"の場合、"py3"にしています。 import sys, yaml if len(sys.argv) < 2: exit() try: with open(sys.argv[1], encoding='utf-8')
matplotlib はPythonにおけるデータ可視化のデファクトスタンダード。 とはいえユーザーが直接これを使ってグラフを描ききるのは難しく、 Rでいうgridパッケージに近い階層と見なしたほうがいいかもしれない。 seaborn 越しに使うのが便利。 基本 https://matplotlib.org/stable/users/explain/quick_start.html import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns iris = sns.load_dataset('iris') # Create an empty Figure fig = plt.figure() # Add an Axes to this fig ax = fig.sub
How can I remove the white border round the top and right of this plot? this is the code I'm using to plot my pandas DataFrame: plt.pcolor(diff,clip_on=False) # diff is a DataFrame plt.yticks(np.arange(0.5, len(diff.index), 1), diff.index) plt.xticks(np.arange(0.5, len(diff.columns), 1), diff.columns, rotation=90) plt.colorbar()
matplotlib と pandas によるさまざまな図の描画方法を以前に紹介しました。しかしその具体的なパラメーターについては触れませんでした。今回から数回に渡り matplotlib による図形描画について追っていこうと思います。 図とサブプロット matplotlib の Figure オブジェクトはプロット機能を提供します。 plt.figure() メソッドは何も描画されていない新しいウィンドウを描画します。 add_subplot() メソッドはその内部にサブプロットを生成します。 import numpy as np from pandas import * from pylab import * import matplotlib.pyplot as plt from matplotlib import font_manager from numpy.random imp
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く