Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature plotting #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
Jul 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3ab7ed1
plotmethod decorator to import matplotlib
Jun 26, 2015
e8671f5
#185 organizing structure for plotting
Jun 27, 2015
bec3054
begin adding docs for plotting
Jun 29, 2015
bd5109f
include png output from plot
Jun 29, 2015
00bed50
multivariate normal example
Jun 29, 2015
edcf55c
fleshing out docs a bit
Jun 29, 2015
26b35f1
test for axis label
Jun 29, 2015
723be1c
plotting works in docs for sin example
Jun 29, 2015
cb100f9
beginning to set up auto docs
Jun 30, 2015
a18ac23
test for ylabel
Jun 30, 2015
2ce0bd9
decorator to skip matplotlib tests
Jun 30, 2015
fabbb91
simple tests passing, working on build
Jun 30, 2015
86b0320
working on making the build work
Jun 30, 2015
eb79aa0
using Agg backend for matplotlib on Travis
Jun 30, 2015
a16d0ad
using slices to pick correct indexes for axis labels
Jun 30, 2015
9c1a268
import matplotlib for appveyor windows build
Jun 30, 2015
05c17c8
fix python3 bug from itemsview
Jun 30, 2015
1994f9a
empty tests with todo for notes on pull requests
Jun 30, 2015
2311507
add FacetGrid class
Jul 2, 2015
a768583
starting on histogram
Jul 6, 2015
d0b2761
imshow
Jul 6, 2015
9b717af
default plot method
Jul 7, 2015
ad1cab6
cleaner plotting tests by assigning to axis object
Jul 7, 2015
ad4ec31
reorganizing plotting docs
Jul 7, 2015
13b5a1b
testing all plotting funcs take axes arg
Jul 8, 2015
62981b7
add links to other plotting libs
Jul 8, 2015
573723f
only plot image plots when the data is coordinates are uniform and so…
Jul 8, 2015
3f13523
add is_uniform_spaced function to utils
Jul 9, 2015
8864527
add link to holoviews
Jul 9, 2015
3bf2375
plotting docs provide a nice spec now
Jul 9, 2015
66b0332
test for uniform and nonuniform 2d plots
Jul 9, 2015
6f48a01
remove positional args from most plot funcs
Jul 9, 2015
d0192da
colorbar is working by passing in mapping
Jul 9, 2015
2d0c893
tests passing after removing position args
Jul 9, 2015
9b6be1d
More docs in simple 2d example
Jul 10, 2015
09c242c
auto aspect ratio for imshow
Jul 10, 2015
2451c47
examples with color maps
Jul 10, 2015
8cb6403
adding maps to docs
Jul 10, 2015
c39d766
first plotting example works
Jul 10, 2015
89e5db0
preparing to check through code with pep8 and pyflakes
Jul 10, 2015
36bb79c
pep8 and pyflakes fixes
Jul 10, 2015
abb7281
add cartopy example
Jul 10, 2015
6ccd06e
add failing tests for informative TypeErrors
Jul 11, 2015
efa5844
fix colorbar with multiple axes
Jul 13, 2015
be1caa9
pass tests for typeerror for index w wrong type
Jul 13, 2015
3dc16c1
address easy feedback from github PR
Jul 13, 2015
f033a20
remove gridlines in generated docs
Jul 14, 2015
b92f426
beginning on 2d plot function decorator
Jul 14, 2015
ced0729
beginning to use mixins for 2d plot tests
Jul 14, 2015
cfeaeca
Common2dMixin for plotting tests complete and working
Jul 14, 2015
2dc914d
2d plotting decorator works for imshow
Jul 14, 2015
6ba054c
_plot2d decorator working well. Deleting old functions
Jul 14, 2015
f65bbfd
use super to finish 2d plot setup in test mixin
Jul 14, 2015
77c19dd
updated transpose example plot with xincrease
Jul 14, 2015
78f6804
tests no longer require to assign axes
Jul 16, 2015
7d67344
breaking tests for returning primitives
Jul 16, 2015
fd0cad2
tests for primitive objects are passing
Jul 16, 2015
7fc9707
docs and tests for np.nans
Jul 16, 2015
021f81f
nans work for all plotting methods now
Jul 16, 2015
28047e4
some pep8 fixes and reorganization
Jul 16, 2015
d657bc5
Merge branch 'master' of github.com:xray/xray into feature-plotting
Jul 17, 2015
9a54bed
incorporate Stephans feedback
Jul 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ nosetests.xml
.project
.pydevproject

# PyCharm
# PyCharm and Vim
.idea
*.swp

# xray specific
doc/_build
doc/generated
doc/_static/*.png
xray/version.py

.ipynb_checkpoints
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ matrix:
env: UPDATE_ENV="conda install unittest2 pandas==0.15.0 h5py cython && pip install h5netcdf"
# Test on Python 2.7 with and without netCDF4/scipy/cdat-lite
- python: 2.7
env: UPDATE_ENV="conda install -c scitools cdat-lite h5py cython && pip install cyordereddict h5netcdf"
env: UPDATE_ENV="conda install -c scitools cdat-lite h5py cython matplotlib && pip install cyordereddict h5netcdf"
- python: 2.7
# nb. we have to remove scipy because conda install pandas brings it in:
# https://github.com/ContinuumIO/anaconda-issues/issues/145
env: UPDATE_ENV="conda remove scipy netCDF4 && conda install dask"
- python: 3.3
env: UPDATE_ENV="conda remove netCDF4"
- python: 3.4
env: UPDATE_ENV="conda install -c pandas bottleneck h5py cython dask && pip install cyordereddict h5netcdf"
env: UPDATE_ENV="conda install -c pandas bottleneck h5py cython dask matplotlib && pip install cyordereddict h5netcdf"
# don't require pydap tests to pass because the dap test server is unreliable
- python: 2.7
env: UPDATE_ENV="pip install pydap"
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ install:
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""

# install xray and depenencies
- "conda install --yes --quiet pip nose numpy pandas scipy netCDF4"
- "conda install --yes --quiet pip nose numpy pandas scipy netCDF4 matplotlib"
- "python setup.py install"

build: false
Expand Down
15 changes: 15 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ Comparisons
DataArray.identical
DataArray.broadcast_equals


.. _api.ufuncs:

Universal functions
Expand Down Expand Up @@ -384,3 +385,17 @@ arguments for the ``from_store`` and ``dump_to_store`` Dataset methods.
backends.H5NetCDFStore
backends.PydapDataStore
backends.ScipyDataStore


Plotting
========

.. autosummary::
:toctree: generated/

DataArray.plot
DataArray.plot_contourf
DataArray.plot_contour
DataArray.plot_hist
DataArray.plot_imshow
DataArray.plot_line
2 changes: 2 additions & 0 deletions doc/computation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Data arrays also implement many :py:class:`numpy.ndarray` methods:
arr.round(2)
arr.T

.. _missing_values:

Missing values
==============

Expand Down
Binary file added doc/examples/atlantic_noise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions doc/examples/cartopy_atlantic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import xray
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs

nlat = 15
nlon = 5
atlantic = xray.DataArray(np.random.randn(nlat, nlon),
coords = (np.linspace(50, 20, nlat), np.linspace(-60, -20, nlon)),
dims = ('latitude', 'longitude'))

ax = plt.axes(projection=ccrs.PlateCarree())

atlantic.plot(ax=ax)

ax.set_ylim(0, 90)
ax.set_xlim(-180, 30)
ax.coastlines()

plt.savefig('atlantic_noise.png')
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Documentation
pandas
io
dask
plotting
api
faq
whats-new
Expand Down
6 changes: 6 additions & 0 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ For parallel computing

- `dask.array <http://dask.pydata.org>`__: required for :ref:`dask`.

For plotting
~~~~~~~~~~~~

- `matplotlib <http://matplotlib.org/>`__: required for :ref:`plotting`.


Instructions
------------

Expand Down
Loading