Skip to content

Fix 3d subplot overwriting #548

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 2 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down
40 changes: 0 additions & 40 deletions appveyor.yml

This file was deleted.

13 changes: 7 additions & 6 deletions src/plot3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down