Repository: pandas-dev/pandas

Issue:
kind='area' plot not showing
Maybe it is a bug, but following problem: In the new Pandas 0.14 you guys implemented an awesome kind='area' option for plot. If I plot a dataframe normally, like

`df.plot()`

![](http://i.stack.imgur.com/4voj8.png)

but when I take the option

`df.plot(kind='area')`, I just get

``` Out[69]:
<matplotlib.axes.AxesSubplot at 0x122794550>
<matplotlib.figure.Figure at 0x121b69e10>
```

in my IPython notebook. I used the `%pylab inline` function, so I don't know, why it is not showing. Any suggestions?



Discussion:
Thx for the report. I'm taking a look, but cannot reproduce the problem even if I use `%pylab inline`.
Please provide:
- Sample data and whole script which causes the problem
- Result of `pd.show_versions()`
- What will happen if you run the same script with normal interpreter and use `plt.show()`?

- Whole script does not work, because I get the data out of a MongoDB, which you do not have :(

``` python
import pandas as pd
from pandas.tseries.resample import TimeGrouper
from pandas.tseries.offsets import DateOffset
from pymongo import MongoClient
#%matplotlib inline
import matplotlib.pyplot as plt
from datetime import datetime
print('Pandas Version: %s' % pd.__version__)
Pandas Version: 0.14.0
%pylab inline --no-import-all

def _connect_mongo(host, port, username, password, db):
    """ A util for making a connection to mongo """

    if username and password:
        mongo_uri = 'mongodb://%s:%s@%s:%s/%s' % (username, password, host, port, db)
        conn = MongoClient(mongo_uri)
    else:
        conn = MongoClient(host, port)


    return conn[db]

def read_mongo(db, collection, query={}, host='localhost', port=27017, username=None, password=None, no_id=True):
    """ Read from Mongo and Store into DataFrame """

    # Connect to MongoDB
    db = _connect_mongo(host=host, port=port, username=username, password=password, db=db)

    # Make a query to the specific DB and Collection
    cursor = db[collection].find(query)

    # Expand the cursor and construct the DataFrame
    df =  pd.DataFrame(list(cursor))

    # Delete the _id
    if no_id:
        del df['_id']

    return df

dbname = 'GNTMTweets'
collection = 'GNTMTweets'
tweets = read_mongo(dbname, collection)

tweets.set_index('created_at', inplace=True)
tweets.index = tweets.index.tz_localize('GMT').tz_convert('CET')
tweets.index.name = 'Zeit'
tweets.index
```

![bildschirmfoto 2014-06-17 um 08 45 01](https://cloud.githubusercontent.com/assets/3329893/3297032/f6bff3f8-f5ea-11e3-89fd-409a649578f7.png)

``` python
tweetsperminute = tweets['text'].resample('1t', how='count')
tweetsperminute.plot(kind='area')
<matplotlib.axes.AxesSubplot at 0x1121a8f50>
<matplotlib.figure.Figure at 0x10e974510>
```
- Version is `0.14.0` (conda)
- If I run it with plt.show(), nothing happens 

If I am using the `area` option in an other notebook (other Dataframe), it works. So maybe there is something with the dataframe, which causes the `area` option not to render.

@balzer82 Can you provide problematic data by `to_csv`, etc?

Aaah, for sure!! Did not thought about that. But is is kind of boring, if I show you the `tweetsperminute.to_csv('dbdump.csv')`:

```
2014-05-08 18:43:00+02:00,5
2014-05-08 18:44:00+02:00,7
2014-05-08 18:45:00+02:00,7
2014-05-08 18:46:00+02:00,12
2014-05-08 18:47:00+02:00,9
2014-05-08 18:48:00+02:00,8
2014-05-08 18:49:00+02:00,12
2014-05-08 18:50:00+02:00,8
2014-05-08 18:51:00+02:00,8
2014-05-08 18:52:00+02:00,9
2014-05-08 18:53:00+02:00,7
2014-05-08 18:54:00+02:00,8
2014-05-08 18:55:00+02:00,2
2014-05-08 18:56:00+02:00,8
2014-05-08 18:57:00+02:00,7
2014-05-08 18:58:00+02:00,3
2014-05-08 18:59:00+02:00,4
2014-05-08 19:00:00+02:00,3
2014-05-08 19:01:00+02:00,5
2014-05-08 19:02:00+02:00,6
2014-05-08 19:03:00+02:00,5
2014-05-08 19:04:00+02:00,3
2014-05-08 19:05:00+02:00,3
2014-05-08 19:06:00+02:00,5
2014-05-08 19:07:00+02:00,8
2014-05-08 19:08:00+02:00,3
2014-05-08 19:09:00+02:00,9
2014-05-08 19:10:00+02:00,6
2014-05-08 19:11:00+02:00,6
2014-05-08 19:12:00+02:00,7
2014-05-08 19:13:00+02:00,10
2014-05-08 19:14:00+02:00,10
2014-05-08 19:15:00+02:00,14
2014-05-08 19:16:00+02:00,7
2014-05-08 19:17:00+02:00,9
2014-05-08 19:18:00+02:00,15
2014-05-08 19:19:00+02:00,8
2014-05-08 19:20:00+02:00,8
2014-05-08 19:21:00+02:00,4
2014-05-08 19:22:00+02:00,9
2014-05-08 19:23:00+02:00,8
2014-05-08 19:24:00+02:00,6
2014-05-08 19:25:00+02:00,7
2014-05-08 19:26:00+02:00,7
2014-05-08 19:27:00+02:00,7
2014-05-08 19:28:00+02:00,7
2014-05-08 19:29:00+02:00,3
2014-05-08 19:30:00+02:00,11
2014-05-08 19:31:00+02:00,6
2014-05-08 19:32:00+02:00,8
2014-05-08 19:33:00+02:00,10
2014-05-08 19:34:00+02:00,6
2014-05-08 19:35:00+02:00,7
2014-05-08 19:36:00+02:00,7
2014-05-08 19:37:00+02:00,7
2014-05-08 19:38:00+02:00,15
2014-05-08 19:39:00+02:00,4
2014-05-08 19:40:00+02:00,6
2014-05-08 19:41:00+02:00,12
2014-05-08 19:42:00+02:00,7
2014-05-08 19:43:00+02:00,11
2014-05-08 19:44:00+02:00,12
2014-05-08 19:45:00+02:00,12
2014-05-08 19:46:00+02:00,6
2014-05-08 19:47:00+02:00,9
2014-05-08 19:48:00+02:00,13
2014-05-08 19:49:00+02:00,13
2014-05-08 19:50:00+02:00,13
2014-05-08 19:51:00+02:00,12
2014-05-08 19:52:00+02:00,18
2014-05-08 19:53:00+02:00,10
2014-05-08 19:54:00+02:00,15
2014-05-08 19:55:00+02:00,4
2014-05-08 19:56:00+02:00,12
2014-05-08 19:57:00+02:00,17
2014-05-08 19:58:00+02:00,23
2014-05-08 19:59:00+02:00,27
2014-05-08 20:00:00+02:00,23
2014-05-08 20:01:00+02:00,20
2014-05-08 20:02:00+02:00,18
2014-05-08 20:03:00+02:00,20
2014-05-08 20:04:00+02:00,22
2014-05-08 20:05:00+02:00,18
2014-05-08 20:06:00+02:00,21
2014-05-08 20:07:00+02:00,32
2014-05-08 20:08:00+02:00,34
2014-05-08 20:09:00+02:00,17
2014-05-08 20:10:00+02:00,28
2014-05-08 20:11:00+02:00,76
2014-05-08 20:12:00+02:00,79
2014-05-08 20:13:00+02:00,112
2014-05-08 20:14:00+02:00,165
2014-05-08 20:15:00+02:00,239
2014-05-08 20:16:00+02:00,261
2014-05-08 20:17:00+02:00,277
2014-05-08 20:18:00+02:00,307
2014-05-08 20:19:00+02:00,291
2014-05-08 20:20:00+02:00,273
2014-05-08 20:21:00+02:00,309
2014-05-08 20:22:00+02:00,342
2014-05-08 20:23:00+02:00,374
2014-05-08 20:24:00+02:00,299
2014-05-08 20:25:00+02:00,318
2014-05-08 20:26:00+02:00,302
2014-05-08 20:27:00+02:00,258
2014-05-08 20:28:00+02:00,208
2014-05-08 20:29:00+02:00,205
2014-05-08 20:30:00+02:00,210
2014-05-08 20:31:00+02:00,179
2014-05-08 20:32:00+02:00,202
2014-05-08 20:33:00+02:00,236
2014-05-08 20:34:00+02:00,220
2014-05-08 20:35:00+02:00,227
2014-05-08 20:36:00+02:00,202
2014-05-08 20:37:00+02:00,175
2014-05-08 20:38:00+02:00,206
2014-05-08 20:39:00+02:00,186
2014-05-08 20:40:00+02:00,218
2014-05-08 20:41:00+02:00,224
2014-05-08 20:42:00+02:00,198
2014-05-08 20:43:00+02:00,213
2014-05-08 20:44:00+02:00,211
2014-05-08 20:45:00+02:00,230
2014-05-08 20:46:00+02:00,204
2014-05-08 20:47:00+02:00,168
2014-05-08 20:48:00+02:00,150
2014-05-08 20:49:00+02:00,136
2014-05-08 20:50:00+02:00,139
2014-05-08 20:51:00+02:00,126
2014-05-08 20:52:00+02:00,135
2014-05-08 20:53:00+02:00,129
2014-05-08 20:54:00+02:00,93
2014-05-08 20:55:00+02:00,125
2014-05-08 20:56:00+02:00,97
2014-05-08 20:57:00+02:00,96
2014-05-08 20:58:00+02:00,86
2014-05-08 20:59:00+02:00,82
2014-05-08 21:00:00+02:00,124
2014-05-08 21:01:00+02:00,233
2014-05-08 21:02:00+02:00,210
2014-05-08 21:03:00+02:00,235
2014-05-08 21:04:00+02:00,179
2014-05-08 21:05:00+02:00,169
2014-05-08 21:06:00+02:00,200
2014-05-08 21:07:00+02:00,176
2014-05-08 21:08:00+02:00,194
2014-05-08 21:09:00+02:00,183
2014-05-08 21:10:00+02:00,236
2014-05-08 21:11:00+02:00,220
2014-05-08 21:12:00+02:00,197
2014-05-08 21:13:00+02:00,252
2014-05-08 21:14:00+02:00,206
2014-05-08 21:15:00+02:00,174
2014-05-08 21:16:00+02:00,223
2014-05-08 21:17:00+02:00,187
2014-05-08 21:18:00+02:00,207
2014-05-08 21:19:00+02:00,190
2014-05-08 21:20:00+02:00,227
2014-05-08 21:21:00+02:00,207
2014-05-08 21:22:00+02:00,181
2014-05-08 21:23:00+02:00,146
2014-05-08 21:24:00+02:00,108
2014-05-08 21:25:00+02:00,130
2014-05-08 21:26:00+02:00,106
2014-05-08 21:27:00+02:00,87
2014-05-08 21:28:00+02:00,109
2014-05-08 21:29:00+02:00,87
2014-05-08 21:30:00+02:00,85
2014-05-08 21:31:00+02:00,75
2014-05-08 21:32:00+02:00,105
2014-05-08 21:33:00+02:00,234
2014-05-08 21:34:00+02:00,186
2014-05-08 21:35:00+02:00,120
2014-05-08 21:36:00+02:00,120
2014-05-08 21:37:00+02:00,114
2014-05-08 21:38:00+02:00,121
2014-05-08 21:39:00+02:00,152
2014-05-08 21:40:00+02:00,168
2014-05-08 21:41:00+02:00,180
2014-05-08 21:42:00+02:00,158
2014-05-08 21:43:00+02:00,234
2014-05-08 21:44:00+02:00,281
2014-05-08 21:45:00+02:00,257
2014-05-08 21:46:00+02:00,244
2014-05-08 21:47:00+02:00,303
2014-05-08 21:48:00+02:00,265
2014-05-08 21:49:00+02:00,253
2014-05-08 21:50:00+02:00,266
2014-05-08 21:51:00+02:00,283
2014-05-08 21:52:00+02:00,243
2014-05-08 21:53:00+02:00,305
2014-05-08 21:54:00+02:00,360
2014-05-08 21:55:00+02:00,320
2014-05-08 21:56:00+02:00,300
2014-05-08 21:57:00+02:00,276
2014-05-08 21:58:00+02:00,242
2014-05-08 21:59:00+02:00,230
2014-05-08 22:00:00+02:00,220
2014-05-08 22:01:00+02:00,226
2014-05-08 22:02:00+02:00,195
2014-05-08 22:03:00+02:00,172
2014-05-08 22:04:00+02:00,129
2014-05-08 22:05:00+02:00,120
2014-05-08 22:06:00+02:00,130
2014-05-08 22:07:00+02:00,112
2014-05-08 22:08:00+02:00,115
2014-05-08 22:09:00+02:00,102
2014-05-08 22:10:00+02:00,101
2014-05-08 22:11:00+02:00,83
2014-05-08 22:12:00+02:00,113
2014-05-08 22:13:00+02:00,128
2014-05-08 22:14:00+02:00,224
2014-05-08 22:15:00+02:00,216
2014-05-08 22:16:00+02:00,326
2014-05-08 22:17:00+02:00,364
2014-05-08 22:18:00+02:00,468
2014-05-08 22:19:00+02:00,500
2014-05-08 22:20:00+02:00,459
2014-05-08 22:21:00+02:00,388
2014-05-08 22:22:00+02:00,327
2014-05-08 22:23:00+02:00,390
2014-05-08 22:24:00+02:00,402
2014-05-08 22:25:00+02:00,299
2014-05-08 22:26:00+02:00,221
2014-05-08 22:27:00+02:00,188
2014-05-08 22:28:00+02:00,173
2014-05-08 22:29:00+02:00,258
2014-05-08 22:30:00+02:00,433
2014-05-08 22:31:00+02:00,480
2014-05-08 22:32:00+02:00,438
2014-05-08 22:33:00+02:00,345
2014-05-08 22:34:00+02:00,329
2014-05-08 22:35:00+02:00,255
2014-05-08 22:36:00+02:00,291
2014-05-08 22:37:00+02:00,267
2014-05-08 22:38:00+02:00,223
2014-05-08 22:39:00+02:00,205
2014-05-08 22:40:00+02:00,169
2014-05-08 22:41:00+02:00,169
2014-05-08 22:42:00+02:00,167
2014-05-08 22:43:00+02:00,166
2014-05-08 22:44:00+02:00,135
2014-05-08 22:45:00+02:00,135
2014-05-08 22:46:00+02:00,129
2014-05-08 22:47:00+02:00,154
2014-05-08 22:48:00+02:00,186
2014-05-08 22:49:00+02:00,238
2014-05-08 22:50:00+02:00,252
2014-05-08 22:51:00+02:00,253
2014-05-08 22:52:00+02:00,226
2014-05-08 22:53:00+02:00,245
2014-05-08 22:54:00+02:00,489
2014-05-08 22:55:00+02:00,884
2014-05-08 22:56:00+02:00,779
2014-05-08 22:57:00+02:00,508
2014-05-08 22:58:00+02:00,366
2014-05-08 22:59:00+02:00,251
2014-05-08 23:00:00+02:00,221
2014-05-08 23:01:00+02:00,163
2014-05-08 23:02:00+02:00,182
2014-05-08 23:03:00+02:00,148
2014-05-08 23:04:00+02:00,130
2014-05-08 23:05:00+02:00,120
2014-05-08 23:06:00+02:00,100
2014-05-08 23:07:00+02:00,99
2014-05-08 23:08:00+02:00,91
2014-05-08 23:09:00+02:00,89
2014-05-08 23:10:00+02:00,66
2014-05-08 23:11:00+02:00,77
2014-05-08 23:12:00+02:00,79
2014-05-08 23:13:00+02:00,73
2014-05-08 23:14:00+02:00,68
2014-05-08 23:15:00+02:00,72
2014-05-08 23:16:00+02:00,71
2014-05-08 23:17:00+02:00,63
2014-05-08 23:18:00+02:00,55
2014-05-08 23:19:00+02:00,44
2014-05-08 23:20:00+02:00,50
2014-05-08 23:21:00+02:00,43
2014-05-08 23:22:00+02:00,51
2014-05-08 23:23:00+02:00,34
2014-05-08 23:24:00+02:00,36
2014-05-08 23:25:00+02:00,37
2014-05-08 23:26:00+02:00,41
2014-05-08 23:27:00+02:00,41
2014-05-08 23:28:00+02:00,29
2014-05-08 23:29:00+02:00,32
2014-05-08 23:30:00+02:00,32
2014-05-08 23:31:00+02:00,25
2014-05-08 23:32:00+02:00,28
2014-05-08 23:33:00+02:00,25
2014-05-08 23:34:00+02:00,26
2014-05-08 23:35:00+02:00,26
2014-05-08 23:36:00+02:00,0
2014-05-08 23:37:00+02:00,0
2014-05-08 23:38:00+02:00,0
2014-05-08 23:39:00+02:00,0
2014-05-08 23:40:00+02:00,0
2014-05-08 23:41:00+02:00,0
2014-05-08 23:42:00+02:00,0
2014-05-08 23:43:00+02:00,0
2014-05-08 23:44:00+02:00,0
2014-05-08 23:45:00+02:00,0
2014-05-08 23:46:00+02:00,0
2014-05-08 23:47:00+02:00,0
2014-05-08 23:48:00+02:00,0
2014-05-08 23:49:00+02:00,0
2014-05-08 23:50:00+02:00,0
2014-05-08 23:51:00+02:00,0
2014-05-08 23:52:00+02:00,0
2014-05-08 23:53:00+02:00,0
2014-05-08 23:54:00+02:00,0
2014-05-08 23:55:00+02:00,3
2014-05-08 23:56:00+02:00,17
2014-05-08 23:57:00+02:00,11
2014-05-08 23:58:00+02:00,12
2014-05-08 23:59:00+02:00,15
2014-05-09 00:00:00+02:00,18
2014-05-09 00:01:00+02:00,4
2014-05-09 00:02:00+02:00,7
2014-05-09 00:03:00+02:00,15
2014-05-09 00:04:00+02:00,10
2014-05-09 00:05:00+02:00,15
2014-05-09 00:06:00+02:00,7
2014-05-09 00:07:00+02:00,9
2014-05-09 00:08:00+02:00,12
2014-05-09 00:09:00+02:00,6
2014-05-09 00:10:00+02:00,11
2014-05-09 00:11:00+02:00,11
2014-05-09 00:12:00+02:00,8
2014-05-09 00:13:00+02:00,12
2014-05-09 00:14:00+02:00,2
2014-05-09 00:15:00+02:00,8
2014-05-09 00:16:00+02:00,5
2014-05-09 00:17:00+02:00,4
2014-05-09 00:18:00+02:00,5
2014-05-09 00:19:00+02:00,5
2014-05-09 00:20:00+02:00,3
2014-05-09 00:21:00+02:00,7
2014-05-09 00:22:00+02:00,3
2014-05-09 00:23:00+02:00,7
2014-05-09 00:24:00+02:00,4
2014-05-09 00:25:00+02:00,7
2014-05-09 00:26:00+02:00,6
2014-05-09 00:27:00+02:00,5
2014-05-09 00:28:00+02:00,6
2014-05-09 00:29:00+02:00,3
2014-05-09 00:30:00+02:00,0
2014-05-09 00:31:00+02:00,2
2014-05-09 00:32:00+02:00,2
2014-05-09 00:33:00+02:00,2
2014-05-09 00:34:00+02:00,1
2014-05-09 00:35:00+02:00,2
2014-05-09 00:36:00+02:00,6
2014-05-09 00:37:00+02:00,3
2014-05-09 00:38:00+02:00,1
2014-05-09 00:39:00+02:00,1
2014-05-09 00:40:00+02:00,1
2014-05-09 00:41:00+02:00,1
2014-05-09 00:42:00+02:00,3
2014-05-09 00:43:00+02:00,4
2014-05-09 00:44:00+02:00,3
2014-05-09 00:45:00+02:00,0
2014-05-09 00:46:00+02:00,5
2014-05-09 00:47:00+02:00,3
2014-05-09 00:48:00+02:00,4
2014-05-09 00:49:00+02:00,1
2014-05-09 00:50:00+02:00,1
2014-05-09 00:51:00+02:00,4
2014-05-09 00:52:00+02:00,4
2014-05-09 00:53:00+02:00,10
2014-05-09 00:54:00+02:00,8
2014-05-09 00:55:00+02:00,5
2014-05-09 00:56:00+02:00,5
2014-05-09 00:57:00+02:00,4
2014-05-09 00:58:00+02:00,3
2014-05-09 00:59:00+02:00,5
2014-05-09 01:00:00+02:00,3
2014-05-09 01:01:00+02:00,2
2014-05-09 01:02:00+02:00,5
2014-05-09 01:03:00+02:00,3
2014-05-09 01:04:00+02:00,6
2014-05-09 01:05:00+02:00,8
2014-05-09 01:06:00+02:00,8
2014-05-09 01:07:00+02:00,4
2014-05-09 01:08:00+02:00,5
2014-05-09 01:09:00+02:00,6
2014-05-09 01:10:00+02:00,3
2014-05-09 01:11:00+02:00,4
2014-05-09 01:12:00+02:00,0
2014-05-09 01:13:00+02:00,0
2014-05-09 01:14:00+02:00,5
2014-05-09 01:15:00+02:00,3
2014-05-09 01:16:00+02:00,2
2014-05-09 01:17:00+02:00,1
2014-05-09 01:18:00+02:00,2
2014-05-09 01:19:00+02:00,5
2014-05-09 01:20:00+02:00,0
2014-05-09 01:21:00+02:00,3
2014-05-09 01:22:00+02:00,2
2014-05-09 01:23:00+02:00,1
2014-05-09 01:24:00+02:00,3
2014-05-09 01:25:00+02:00,3
2014-05-09 01:26:00+02:00,1
2014-05-09 01:27:00+02:00,1
2014-05-09 01:28:00+02:00,2
2014-05-09 01:29:00+02:00,1
```

I do not know, why it is not working. Looks pretty clean.

Thanks, I could reproduce the issue using your data. I'll dig in.

```
# 'data' variable contains your data
tweets = pd.read_csv(compat.StringIO(data))
tweets['Zeit'] = tweets['Zeit'].astype(np.datetime64)
tweets = tweets.set_index('Zeit')
tweets.plot(kind='area')
# OK
```

Problem seems to be caused by tz-aware index.

```
tweets.index = tweets.index.tz_localize('GMT').tz_convert('CET')
tweets.plot(kind='area')
#   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/dates.py", line 214, in _from_ordinalf
#     dt = datetime.datetime.fromordinal(ix)
# ValueError: ordinal must be >= 1
```


Resolving patch:
diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py
--- a/pandas/tools/plotting.py
+++ b/pandas/tools/plotting.py
@@ -1767,7 +1767,9 @@ def _post_plot_logic(self):
         else:
             if self.xlim is None:
                 for ax in self.axes:
-                    ax.set_xlim(0, len(self.data)-1)
+                    lines = _get_all_lines(ax)
+                    left, right = _get_xlim(lines)
+                    ax.set_xlim(left, right)
 
         if self.ylim is None:
             if (self.data >= 0).all().all():
@@ -3083,21 +3085,12 @@ def _get_all_lines(ax):
 def _get_xlim(lines):
     left, right = np.inf, -np.inf
     for l in lines:
-        x = l.get_xdata()
-        left = min(_maybe_convert_date(x[0]), left)
-        right = max(_maybe_convert_date(x[-1]), right)
+        x = l.get_xdata(orig=False)
+        left = min(x[0], left)
+        right = max(x[-1], right)
     return left, right
 
 
-def _maybe_convert_date(x):
-    if not com.is_integer(x):
-        conv_func = conv._dt_to_float_ordinal
-        if isinstance(x, datetime.time):
-            conv_func = conv._to_ordinalf
-        x = conv_func(x)
-    return x
-
-
 if __name__ == '__main__':
     # import pandas.rpy.common as com
     # sales = com.load_data('sanfrancisco.home.sales', package='nutshell')


Test patch:
diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py
--- a/pandas/tests/test_graphics.py
+++ b/pandas/tests/test_graphics.py
@@ -460,9 +460,33 @@ def test_plot_figsize_and_title(self):
     def test_ts_area_lim(self):
         ax = self.ts.plot(kind='area', stacked=False)
         xmin, xmax = ax.get_xlim()
-        lines = ax.get_lines()
-        self.assertEqual(xmin, lines[0].get_data(orig=False)[0][0])
-        self.assertEqual(xmax, lines[0].get_data(orig=False)[0][-1])
+        line = ax.get_lines()[0].get_data(orig=False)[0]
+        self.assertEqual(xmin, line[0])
+        self.assertEqual(xmax, line[-1])
+        tm.close()
+
+        # GH 7471
+        ax = self.ts.plot(kind='area', stacked=False, x_compat=True)
+        xmin, xmax = ax.get_xlim()
+        line = ax.get_lines()[0].get_data(orig=False)[0]
+        self.assertEqual(xmin, line[0])
+        self.assertEqual(xmax, line[-1])
+        tm.close()
+
+        tz_ts = self.ts.copy()
+        tz_ts.index = tz_ts.tz_localize('GMT').tz_convert('CET')
+        ax = tz_ts.plot(kind='area', stacked=False, x_compat=True)
+        xmin, xmax = ax.get_xlim()
+        line = ax.get_lines()[0].get_data(orig=False)[0]
+        self.assertEqual(xmin, line[0])
+        self.assertEqual(xmax, line[-1])
+        tm.close()
+
+        ax = tz_ts.plot(kind='area', stacked=False, secondary_y=True)
+        xmin, xmax = ax.get_xlim()
+        line = ax.get_lines()[0].get_data(orig=False)[0]
+        self.assertEqual(xmin, line[0])
+        self.assertEqual(xmax, line[-1])
 
     def test_line_area_nan_series(self):
         values = [1, 2, np.nan, 3]