赞
踩
我试图绘制一个动态大小的气泡图(散点图)。当我试图用随机数据作图时,我能很好地作图。但当我试图分析我的输入文件时,我无法绘制。
输入:Nos,Place,Way,Name,00:00:00,12:00:00
123,London,Air,Apollo,342,972
123,London,Rail,Beta,2352,342
123,Paris,Bus,Beta,545,353
345,Paris,Bus,Rava,652,974
345,Rome,Bus,Rava,2325,56
345,London,Air,Rava,2532,9853
567,Paris,Air,Apollo,545,544
567,Rome,Rail,Apollo,5454,5
876,Japan,Rail,Apollo,644,54
876,Japan,Bus,Beta,45,57
程序:import pandas as pd
from pandas import DataFrame
import pandas.io.data
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
df=pd.read_csv('text_2.csv')
#SIZE OF BUBBLES CHANGES
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.scatter(df['Place'],df['Name'], s=df['00:00:00']) # Added third variable income as size of the
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。