問題
jupyter notebookにてpandasのDataFrameより円グラフを作成しました。
そこで円グラフを出力することはできましたが、円グラフの参照データも同時に出力されてしまいました。
解決したいこと
先述の出力を円グラフのみにしたい。円グラフの参照データを出力しないようにしたい。
環境
windows7
python3.6.3
jupyter 1.0.0
matplotlib 2.2.2
スクリプト
import pandas as pd import matplotlib import matplotlib.pyplot as plt %matplotlib inline plt.style.use('ggplot') font = {'family' : 'IPAexGothic'} matplotlib.rc('font', **font) df_01=pd.read_csv(current_path+file_names[0],encoding='cp932',engine='python') value_pie=[] label_pie=[] for i in range(len(df_01.index)): value_pie.append(float(df_01.at[i,' 構成比'][0:4])) label_pie.append(df_01.at[i,'名称']) plt.axis('equal') plt.pie(value_pie,labels=label_pie,autopct="%1.1f%%",radius=2.5)
出力
([<matplotlib.patches.Wedge at 0xb3689f0>, <matplotlib.patches.Wedge at 0xb368e50>, <matplotlib.patches.Wedge at 0xb4c22b0>, <matplotlib.patches.Wedge at 0xb4c2750>, <matplotlib.patches.Wedge at 0xb4c2c10>, <matplotlib.patches.Wedge at 0xb4ca1f0>, <matplotlib.patches.Wedge at 0xb4ca590>, <matplotlib.patches.Wedge at 0xb34d490>, <matplotlib.patches.Wedge at 0xb4caeb0>, <matplotlib.patches.Wedge at 0xb4ca1d0>, <matplotlib.patches.Wedge at 0xb4d37d0>, <matplotlib.patches.Wedge at 0xb4d3c90>, <matplotlib.patches.Wedge at 0xb4de170>, <matplotlib.patches.Wedge at 0xb4de630>, <matplotlib.patches.Wedge at 0xb4deaf0>, <matplotlib.patches.Wedge at 0xb4defb0>, <matplotlib.patches.Wedge at 0xb4e9490>, <matplotlib.patches.Wedge at 0xb4e9950>, <matplotlib.patches.Wedge at 0xb4e9e10>], [Text(2.71331,0.447696,'WJ半日券大人'), Text(2.48776,1.17199,'WJ1日券大人'), Text(2.23391,1.60379,'WJレンタル'), Text(2.05576,1.82657,'WJトランポリン半日券'), Text(1.75105,2.12045,'パークゴルフ'), Text(1.16024,2.49326,'カヌー大P'), Text(0.477532,2.70822,'カヌー小'), Text(-2.41747,1.31086,'ツリーアドベンチャーグリーン小'), Text(-0.629984,-2.67687,'ツリーアドベンチャーグリーン大'), Text(1.65603,-2.19547,'ツリーアドベンチャーオレンジ大P'), Text(2.12321,-1.74771,'クイックジャンプ小人'), Text(2.33944,-1.44552,'ツリーアドベンチャーオレンジ大'), Text(2.47282,-1.20319,'ツリーアドベンチャーオレンジ小'), Text(2.5533,-1.02134,'ツリーアドベンチャーグリーン大P'), Text(2.6178,-0.84239,'ツリーアドベンチャーオレンジ小P'), Text(2.65461,-0.718014,'ツリーシューズ 靴下 セット\u3000'), Text(2.66768,-0.667801,'ツリーシューズレンタル'), Text(2.72605,-0.362161,'トランポリン'), Text(2.74978,-0.0345898,'トランポリンP')], [Text(1.47999,0.244198,'5.2%'), Text(1.35696,0.639266,'3.6%'), Text(1.2185,0.874795,'2.2%'), Text(1.12132,0.996313,'1.1%'), Text(0.955118,1.15661,'3.8%'), Text(0.632858,1.35996,'4.3%'), Text(0.260472,1.47721,'4.0%'), Text(-1.31862,0.715012,'35.7%'), Text(-0.343628,-1.46011,'22.7%'), Text(0.903288,-1.19753,'5.2%'), Text(1.15811,-0.953298,'2.3%'), Text(1.27606,-0.788468,'2.0%'), Text(1.34881,-0.656284,'1.2%'), Text(1.39271,-0.557095,'1.1%'), Text(1.42789,-0.459485,'1.1%'), Text(1.44797,-0.391644,'0.4%'), Text(1.4551,-0.364255,'0.2%'), Text(1.48694,-0.197542,'3.4%'), Text(1.49988,-0.0188672,'0.4%')])
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/07/27 06:47