Skip to content

Projection option for add_subplot #458

@adamnemecek

Description

@adamnemecek

Hello,
When I call fig.add_subplot with the projection option, I get an error.

Code:

using PyPlot
fig = plt.figure()
ax = fig[:add_subplot](111, projection="3d")

Error:

ERROR: PyError ($(Expr(:escape, :(ccall(#= /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:44 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'ValueError'>
ValueError("Unknown projection '3d'")
  File "/Users/adamnemecek/.julia/conda/3/lib/python3.7/site-packages/matplotlib/figure.py", line 1396, in add_subplot
    self._process_projection_requirements(*args, **kwargs)
  File "/Users/adamnemecek/.julia/conda/3/lib/python3.7/site-packages/matplotlib/figure.py", line 1120, in _process_projection_requirements
    projection_class = projections.get_projection_class(projection)
  File "/Users/adamnemecek/.julia/conda/3/lib/python3.7/site-packages/matplotlib/projections/__init__.py", line 60, in get_projection_class
    raise ValueError("Unknown projection %r" % projection)

Stacktrace:
 [1] pyerr_check at /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/exception.jl:60 [inlined]
 [2] pyerr_check at /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/exception.jl:64 [inlined]
 [3] macro expansion at /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/exception.jl:84 [inlined]
 [4] __pycall!(::PyCall.PyObject, ::Ptr{PyCall.PyObject_struct}, ::PyCall.PyObject, ::PyCall.PyObject) at /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:44
 [5] _pycall!(::PyCall.PyObject, ::PyCall.PyObject, ::Tuple{Int64}, ::Int64, ::PyCall.PyObject) at /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:29
 [6] _pycall!(::PyCall.PyObject, ::PyCall.PyObject, ::Tuple{Int64}, ::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol},NamedTuple{(:projection,),Tuple{String}}}) at /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:11
 [7] #call#111 at /Users/adamnemecek/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:89 [inlined]
 [8] (::getfield(PyCall, Symbol("#kw#PyObject")))(::NamedTuple{(:projection,),Tuple{String}}, ::PyCall.PyObject, ::Int64) at ./none:0
 [9] top-level scope at none:0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions