questions anon
2015-10-29 01:54:00 UTC
I have calculated annual temperature anomaly and I would like to plot as a
bar plot with all values positive make red and all values negative make blue
I am using pandas and the time series data in this example are called
'anomaly'
mybarplot=anomaly.plot(kind='bar')
the data look like this:
time
2003-01-01 -0.370800
2004-01-01 -0.498199
2005-01-01 0.246118
2006-01-01 -0.313321
2007-01-01 0.585050
2008-01-01 -0.227976
2009-01-01 0.439337
2010-01-01 0.135607
2011-01-01 0.106105
2012-01-01 -0.102002
Freq: AS-JAN, dtype: float64
is there some simple way of writing:
meantempanomaly.plot(kind='bar', anomaly>0:'r', anomaly<0:'b' )
Any feedback will be greatly appreciated
bar plot with all values positive make red and all values negative make blue
I am using pandas and the time series data in this example are called
'anomaly'
mybarplot=anomaly.plot(kind='bar')
the data look like this:
time
2003-01-01 -0.370800
2004-01-01 -0.498199
2005-01-01 0.246118
2006-01-01 -0.313321
2007-01-01 0.585050
2008-01-01 -0.227976
2009-01-01 0.439337
2010-01-01 0.135607
2011-01-01 0.106105
2012-01-01 -0.102002
Freq: AS-JAN, dtype: float64
is there some simple way of writing:
meantempanomaly.plot(kind='bar', anomaly>0:'r', anomaly<0:'b' )
Any feedback will be greatly appreciated