diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..8d431179 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,46 @@ +name: CI +on: + pull_request: + push: + branches: + - master + tags: '*' +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.0' + - '1' +# - 'nightly' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2314a185..00000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: julia -os: - - linux -julia: - - 0.7 - - 1.0 - - nightly -addons: - apt: - packages: - - python-matplotlib - - python3-matplotlib -env: - matrix: - - PYTHON=python # python 2.7 - - PYTHON=python3 # python 3.5 -notifications: - email: false diff --git a/README.md b/README.md index 83c82939..a7df28ef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![Build Status](https://travis-ci.org/JuliaPy/PyPlot.jl.svg?branch=master)](https://travis-ci.org/JuliaPy/PyPlot.jl) -[![Build status](https://ci.appveyor.com/api/projects/status/github/JuliaPy/PyPlot.jl?branch=master)](https://ci.appveyor.com/project/StevenGJohnson/pyplot-jl/branch/master) +[![CI](https://github.com/JuliaPy/PyPlot.jl/workflows/CI/badge.svg)](https://github.com/JuliaPy/PyPlot.jl/actions?query=workflow%3ACI) # The PyPlot module for Julia @@ -9,7 +8,7 @@ specifically to the `matplotlib.pyplot` module. PyPlot uses the Julia [PyCall](https://github.com/stevengj/PyCall.jl) package to call Matplotlib directly from Julia with little or no -overhead (arrays are passed without making a copy). +overhead (arrays are passed without making a copy). (See also [PythonPlot.jl](https://github.com/stevengj/PythonPlot.jl) for a version of PyPlot.jl using the alternative [PythonCall.jl](https://github.com/cjdoris/PythonCall.jl) package.) This package takes advantage of Julia's [multimedia I/O](https://docs.julialang.org/en/latest/base/io-network/#Multimedia-I/O-1) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 573b986d..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,40 +0,0 @@ -environment: - matrix: - - julia_version: 0.7 - PYTHON: "Conda" - - julia_version: 1 - PYTHON: "Conda" - - julia_version: nightly - PYTHON: "Conda" - -platform: - - x86 # 32-bit - - x64 # 64-bit - -# # Uncomment the following lines to allow failures on nightly julia -# # (tests will run but not make your overall status red) -# matrix: -# allow_failures: -# - julia_version: nightly - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" diff --git a/src/plot3d.jl b/src/plot3d.jl index d4b917c0..c910a06a 100644 --- a/src/plot3d.jl +++ b/src/plot3d.jl @@ -54,12 +54,15 @@ const mplot3d_funcs = (:bar3d, :contour3D, :contourf3D, :plot3D, :plot_surface, :plot_trisurf, :plot_wireframe, :scatter3D, :text2D, :text3D, :view_init, :voxels) +function gca3d() + using3D() # make sure mplot3d is loaded + return PyPlot.version <= v"3.4" ? gca(projection="3d") : plt."subplot"(gca()."get_subplotspec"(), projection="3d") +end + for f in mplot3d_funcs fs = string(f) @eval @doc LazyHelp(axes3D,"Axes3D", $fs) function $f(args...; kws...) - using3D() # make sure mplot3d is loaded - ax = PyPlot.version <= v"3.4" ? gca(projection="3d") : plt."subplot"(projection="3d") - pycall(ax.$fs, PyAny, args...; kws...) + pycall(gca3d().$fs, PyAny, args...; kws...) end end @@ -73,9 +76,7 @@ const zlabel_funcs = (:zlabel, :zlim, :zscale, :zticks) for f in zlabel_funcs fs = string("set_", f) @eval @doc LazyHelp(axes3D,"Axes3D", $fs) function $f(args...; kws...) - using3D() # make sure mplot3d is loaded - ax = PyPlot.version <= v"3.4" ? gca(projection="3d") : plt."subplot"(projection="3d") - pycall(ax.$fs, PyAny, args...; kws...) + pycall(gca3d().$fs, PyAny, args...; kws...) end end