当前位置:   article > 正文

python画气泡图_matplotlib中的气泡图或热图

python条形气泡热图

我试图绘制一个动态大小的气泡图(散点图)。当我试图用随机数据作图时,我能很好地作图。但当我试图分析我的输入文件时,我无法绘制。

输入: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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/662378
推荐阅读
相关标签
  

闽ICP备14008679号