Skip to content

Commit

Permalink
Merge branch 'master' of github.com:matplotlib/matplotlib into category
Browse files Browse the repository at this point in the history
  • Loading branch information
story645 committed Jul 7, 2016
2 parents 89bd77d + 94f2fb8 commit 6f23d0f
Show file tree
Hide file tree
Showing 17 changed files with 127 additions and 195 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Adrien F. Vincent <vincent.adrien@gmail.com>
Andrew Dawson <ajdawson@acm.org> <dawson@atm.ox.ac.uk>
anykraus <kraus@mpip-mainz.mpg.de> <anykraus@users.noreply.github.com>
Ariel Hernán Curiale <curiale@gmail.com>
Expand Down
5 changes: 4 additions & 1 deletion README.win.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ without fiddling with environment variables.

``` sh
# create a new environment with the required packages
conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado pyqt cycler tk libpng zlib freetype
conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
activate matplotlib_build
# if you want a qt backend, you also have to install pyqt (be aware that pyqt doesn't mix well if
# you have created the environment with conda-forge already activated...)
conda install pyqt
# this package is only available in the conda-forge channel
conda install -c conda-forge msinttypes
# for python 2.7
Expand Down
69 changes: 57 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,36 @@ environment:

matrix:
# for testing purpose: numpy 1.8 on py2.7, for the rest use 1.10/latest
# theoretically the CONDA_INSTALL_LOCN could be only two: one for 32bit, one for 64bit
# but using one for the right python version is hopefully making it fast due to package caching.
- TARGET_ARCH: "x86"
CONDA_PY: "27"
CONDA_NPY: "18"
PYTHON_VERSION: "2.7"
# this variable only influence pdf/svg tests, png tests are run on any platform
# only once, because it basically triples the testing times
# pick the one which seems to make the most problems
TEST_ALL_IMAGES: "yes"
CONDA_INSTALL_LOCN: "C:\\Miniconda"
- TARGET_ARCH: "x64"
CONDA_PY: "27"
CONDA_NPY: "18"
PYTHON_VERSION: "2.7"
TEST_ALL_IMAGES: "no"
CONDA_INSTALL_LOCN: "C:\\Miniconda-x64"
- TARGET_ARCH: "x64"
CONDA_PY: "34"
CONDA_NPY: "110"
PYTHON_VERSION: "3.4"
TEST_ALL_IMAGES: "no"
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
- TARGET_ARCH: "x64"
CONDA_PY: "35"
CONDA_NPY: "110"
PYTHON_VERSION: "3.5"
TEST_ALL_IMAGES: "no"
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"


# We always use a 64-bit machine, but can build x86 distributions
# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV).
platform:
Expand All @@ -53,11 +61,14 @@ init:
install:
- cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
- cmd: set PYTHONUNBUFFERED=1
- cmd: conda install -c http://conda.anaconda.org/pelson/channel/development --yes --quiet obvious-ci
- cmd: obvci_install_conda_build_tools.py
- cmd: conda config --set show_channel_urls yes
# for msinttypes
# for obvci_appveyor_python_build_env.cmd
- cmd: conda install -c pelson/channel/development --yes --quiet obvious-ci
# for msinttypes and newer stuff
- cmd: conda config --add channels conda-forge
- cmd: conda config --set show_channel_urls yes
- cmd: conda config --set always_yes true
# For building conda packages
- cmd: conda install --yes conda-build jinja2 anaconda-client
# this is now the downloaded conda...
- conda info -a

Expand All @@ -68,17 +79,25 @@ install:
# VS tools instead of the also installed Py27 VS compiler (which wouldn't need this workarounds...)
- cmd: copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat"

# For building, use a new environment which only includes the requirements for mpl
# same things as the requirements in ci/conda_recipe/meta.yaml
- cmd: conda create -y -q -n test-environment python=%PYTHON_VERSION% pip setuptools numpy python-dateutil freetype msinttypes tk pyparsing pytz tornado libpng zlib pyqt cycler nose mock msvc_runtime
# if conda-forge gets a new pyqt, it might be nice to install it as well to have more backends
# https://github.com/conda-forge/conda-forge.github.io/issues/157#issuecomment-223536381
- cmd: conda create -q -n test-environment python=%PYTHON_VERSION% pip setuptools numpy python-dateutil freetype=2.6 msinttypes "tk=8.5" pyparsing pytz tornado "libpng>=1.6.21,<1.7" "zlib=1.2" "cycler>=0.10" nose mock
- activate test-environment
- cmd: echo %PYTHON_VERSION% %TARGET_ARCH%
- cmd: IF %PYTHON_VERSION% == 2.7 conda install -y functools32
- cmd: IF %PYTHON_VERSION% == 2.7 conda install -q functools32

# Let the install prefer the static builds of the libs
- set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib
- cmd: 'mkdir lib || cmd /c "exit /b 0"'
- copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
- copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib
- copy /Y %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
- copy /Y %LIBRARY_LIB%\libpng_static.lib lib\png.lib
# These z.lib / png.lib are not static versions but files which end up as
# dependencies to the dll file. This is fine for the conda build, but not here
# and for the wheels
- del %LIBRARY_LIB%\png.lib
- del %LIBRARY_LIB%\z.lib
- set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
# enables the local freetype build
- copy ci\travis\setup.cfg .
Expand All @@ -88,17 +107,42 @@ install:
test_script:
# Now build the thing..
- '%CMD_IN_ENV% python setup.py develop'
# these should show no z, png, or freetype dll...
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd'
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd'
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0'
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\\matplotlib\\_png*.pyd | findstr z.*.dll && exit /b 1 || exit /b 0'
- cmd: '"%DUMPBIN%" /DEPENDENTS lib\\matplotlib\\_png*.pyd | findstr png.*.dll && exit /b 1 || exit /b 0'

# this are optional dependencies so that we don't skip so many tests...
- cmd: conda install -q pillow miktex
# autoinstall latex packages (0=no, 1=autoinstall, 2=ask)
# this adds this to the registry!
- cmd: initexmf --set-config-value "[MPM]AutoInstall=1"
# we need to put the real exe files into PATH as subprocess can't call bat files
# this works for the "old" version of the miktex package, then next version should
# not need it
- set "PATH=%PATH%;%CONDA_PREFIX%\Library\miktex\miktex\bin"
# missing packages on conda-forge for ffmpeg avconv mencoder imagemagick inkscape
- cmd: conda install -q -c menpo ffmpeg # a repackaged version
# This install sometimes failed randomly :-(
#- cmd: choco install imagemagick
# only install inkscape during one test run as it increases the runtime of one
# test run from 13 min -> 30 min
- cmd: if x%TEST_ALL_IMAGES% == xyes; choco install inkscape
- cmd: if x%TEST_ALL_IMAGES% == xyes; set "PATH=%PATH%;C:\Program Files\Inkscape\inkscape.com"
# Test import of tkagg backend
- python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
# tests
- python tests.py
# remove to get around libpng issue?
# Generate a html for visual tests
- python visual_tests.py

after_test:
# After the tests were a success, build packages (wheels and conda)

# Build the wheel
# Build the wheel with the static libs
# Hide the output, the copied files really clutter the build log...
- cmd: '%CMD_IN_ENV% python setup.py bdist_wheel > NUL:'

Expand All @@ -112,7 +156,8 @@ after_test:
- cmd: path
- cmd: where python
- cmd: '%CMD_IN_ENV% conda config --get channels'
# - cmd: '%CMD_IN_ENV% conda build .\ci\conda_recipe'
# currently disabled as conda-build errors :-(
#- cmd: '%CMD_IN_ENV% conda build -q .\ci\conda_recipe'

# Move the conda package into the dist directory, to register it
# as an "artifact" for Appveyor.
Expand Down
12 changes: 7 additions & 5 deletions build_alllocal.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
:: This assumes you have installed all the dependencies via conda packages:
:: # create a new environment with the required packages
:: conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado pyqt cycler tk libpng zlib freetype
:: conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
:: activate matplotlib_build
:: if you want qt backend, you also have to install pyqt
:: conda install pyqt
:: # this package is only available in the conda-forge channel
:: conda install -c conda-forge msinttypes
:: if you build on py2.7:
Expand All @@ -15,20 +17,20 @@ IF [%1]==[] (
echo Using user supplied target: %TARGET%
)

IF NOT DEFINED CONDA_DEFAULT_ENV (
IF NOT DEFINED CONDA_PREFIX (
echo No Conda env activated: you need to create a conda env with the right packages and activate it!
GOTO:eof
)

:: copy the libs which have "wrong" names
set LIBRARY_LIB=%CONDA_DEFAULT_ENV%\Library\lib
set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib
mkdir lib || cmd /c "exit /b 0"
copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib

:: Make the header files and the rest of the static libs available during the build
:: CONDA_DEFAULT_ENV is a env variable which is set to the currently active environment path
set MPLBASEDIRLIST=%CONDA_DEFAULT_ENV%\Library\;.
:: CONDA_PREFIX is a env variable which is set to the currently active environment path
set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.

:: build the target
python setup.py %TARGET%
6 changes: 5 additions & 1 deletion ci/conda_recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ ECHO tests = False >> setup.cfg
ECHO sample_data = False >> setup.cfg
ECHO toolkits_tests = False >> setup.cfg

%PYTHON% setup.py install
@rem workaround for https://github.com/matplotlib/matplotlib/issues/6460
@rem see also https://github.com/conda-forge/libpng-feedstock/pull/4
copy /y %LIBRARY_LIB%\libpng16.lib %LIBRARY_LIB%\png.lib

%PYTHON% setup.py install --single-version-externally-managed --record=record.txt
if errorlevel 1 exit 1
2 changes: 1 addition & 1 deletion ci/conda_recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ cat setup.cfg
sed -i.bak "s|/usr/local|$PREFIX|" setupext.py


$PYTHON setup.py install
$PYTHON setup.py install --single-version-externally-managed --record=record.txt

1 change: 1 addition & 0 deletions ci/conda_recipe/condaversion.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ index 8af8b6d..4e4f9d2 100644

# These are the packages in the order we want to display them. This
# list may contain strings to create section headers for the display.

51 changes: 25 additions & 26 deletions ci/conda_recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package:
name: matplotlib
version: 1.5.1.9
version: 1.9.9

source:
path: ../../
Expand All @@ -13,50 +13,47 @@ source:
- cfg_qt4agg.patch # [linux]
# Patches the matplotlibrc template to default to Qt4.
- rctmp_pyside.patch # [not osx]
# Patches setupext to look in PREFIX for the tcl/tk headers.
- osx-tk.patch # [osx]
# dynamic version from git
# we can't use condas usual dynamic versions as setup.py uses a guard
# around the setup call against importing, which is done internaly
# by conda build to get the version.
# https://github.com/matplotlib/matplotlib/pull/5629#issuecomment-167243654
# we can't use condas usual dynamic versions as setup.py uses
# multiprocessing during the configure stage and this seems to confuse conda-build.
# https://github.com/conda/conda-build/issues/1061
- condaversion.patch


requirements:
build:
- python
- setuptools
- pkg-config # [not win]
- numpy x.x
- python-dateutil
- freetype
- msinttypes # [win]
- cycler
- freetype 2.6*
- msinttypes # [win]
- cycler >=0.10
- nose
- pyparsing
- pytz
# - py2cairo # [linux and py2k]
# - py2cairo # [linux and py2k]
- tornado
- libpng
- zlib # [win]
- pyqt # [not osx]
- tk # [linux and win]
- functools32 # [py2k]
- msvc_runtime # [win]
- libpng >=1.6.21,<1.7
- zlib 1.2* # [win]
- pyqt # [not osx]
- tk 8.5* # [linux]
- functools32 # [py2k]

run:
- python
- numpy x.x
- cycler
- cycler >=0.10
- python-dateutil
- freetype
- freetype 2.6*
- pytz
- pyparsing
# - py2cairo # [linux and py2k]
- libpng
- pyqt # [not osx]
- tk # [linux and win]
- functools32 # [py2k]
- msvc_runtime # [win]
# - py2cairo # [linux and py2k]
- libpng >=1.6.21,<1.7
- pyqt # [not osx]
- tk 8.5* # [linux and win]
- functools32 # [py2k]

test:
imports:
Expand All @@ -70,6 +67,8 @@ about:

extra:
recipe-maintainers:
- janschulz # only in the mpl repository
- mdboom # rest form conda-forge
- ocefpaf
- pelson
- tacaswell
- JanSchulz
8 changes: 4 additions & 4 deletions examples/pie_and_polar_charts/polar_scatter_demo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Demo of scatter plot on a polar axis.
Size increases radially in this example and color increases with angle (just to
verify the symbols are being scattered correctly).
Size increases radially in this example and color increases with angle
(just to verify the symbols are being scattered correctly).
"""
import numpy as np
import matplotlib.pyplot as plt
Expand All @@ -11,11 +11,11 @@
N = 150
r = 2 * np.random.rand(N)
theta = 2 * np.pi * np.random.rand(N)
area = 200 * r**2 * np.random.rand(N)
area = 200 * r**2
colors = theta

ax = plt.subplot(111, projection='polar')
c = plt.scatter(theta, r, c=colors, s=area, cmap=plt.cm.hsv)
c = ax.scatter(theta, r, c=colors, s=area, cmap=plt.cm.hsv)
c.set_alpha(0.75)

plt.show()
3 changes: 2 additions & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,8 @@ def grid(self, b=None, which='major', axis='both', **kwargs):
"""
if len(kwargs):
b = True
b = _string_to_bool(b)
elif b is not None:
b = _string_to_bool(b)

if axis == 'x' or axis == 'both':
self.xaxis.grid(b, which=which, **kwargs)
Expand Down

0 comments on commit 6f23d0f

Please sign in to comment.