問題点 以下のようなコマンドで、グラフのタイトルに「日本語」を表示させようとしましたが、日本語部分が「□□□」と文字化けしてしまっています。 %matplotlib inline from matplotlib import pyplot as plt plt.style.use('ggplot') plt.figure(figsize=(12,5)) plt.plot(0,0) plt.title("日本語") matplotlibで使用可能なフォント一覧を調べる 以下のコマンドで読み込まれている、matplotlibで使用可能なフォント一覧を調べます。 import matplotlib.font_manager as fm fm.findSystemFonts() """ ●出力結果 ['/usr/share/fonts/opentype/ipaexfont-gothic/ipaex
Overview¶ The idea behind choosing a good colormap is to find a good representation in 3D colorspace for your data set. The best colormap for any given data set depends on many things including: Whether representing form or metric data ([Ware]) Your knowledge of the data set (e.g., is there a critical value from which the other values deviate?) If there is an intuitive color scheme for the paramet
This is a brief post on how to draw animated GIFs with Python using matplotlib. I tried the code shown here on a Ubuntu machine with ImageMagick installed. ImageMagick is required for matplotlib to render animated GIFs with the save method. Here's a sample animated graph: A couple of things to note: The scatter part of the graph is unchanging; the line is changing. The X axis title is changing in
pythonで株やFXなんかで使うローソク足チャートを書きたかったのですが、ちょっと苦戦したのでメモ。 完成品はこんな感じです。 ソースコードはこんな感じ。 Copy import pandas import matplotlib.pyplot as plt from matplotlib.finance import candlestick_ohlc dat = pandas.read_csv('usdjpy.csv', parse_dates=['日付']) # ファイルの読み込み。 dat = dat[-50:] # データが多すぎるので減らす。 dates = dat['日付'] # あとでつかう。 tmp = dat['日付'].values.astype('datetime64[D]') # ナノ秒精度とか無意味なので、精度を日単位まで落とす。 dat['日付'] = tmp.
準備 データ処理用にnumpy、プロット用にpyplot、3次元なのでmpl_toolkits.mplot3dをインポートします。 from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np 描画するデータの作成 3次元で描画するにはメッシュ(2次元の網目)を作成するために2次元の配列を用意する必要があります。 まずarangeメソッドでx,yそれぞれを1次元領域で分割します。 x = np.arange(-3, 3, 0.25) y = np.arange(-3, 3, 0.25) 2次元メッシュを作成するにはmeshgridメソッドを利用します。この関数の戻り値はX,Yに対応する行列で、Xは行にxの配列を、Yは列にyの配列を入れたものになっています。 X, Y =
""" ================== 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
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く