Skip to content

tight_layout() gives error #153

@colincsl

Description

@colincsl

I would like to be able to call tight_layout() to automatically rescale my plots so that they fit better the figure. Currently I call axis("tight") after every imshow(...) which is annoying.

However, when I call tight_layout() I get the following error message:

PyError (:PyObject_Call) 
ValueError('max() arg is an empty sequence',)
  File "/Library/Python/2.7/site-packages/matplotlib/pyplot.py", line 1288, in tight_layout
    fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
  File "/Library/Python/2.7/site-packages/matplotlib/figure.py", line 1663, in tight_layout
    rect=rect)
  File "/Library/Python/2.7/site-packages/matplotlib/tight_layout.py", line 325, in get_tight_layout_figure
    max_nrows = max(nrows_list)

while loading In[12], in expression starting on line 1

 in getindex at /Users/colin/.julia/v0.3/PyCall/src/PyCall.jl:255
 in pysequence_query at /Users/colin/.julia/v0.3/PyCall/src/conversions.jl:778
 in pytype_query at /Users/colin/.julia/v0.3/PyCall/src/conversions.jl:794
 in convert at /Users/colin/.julia/v0.3/PyCall/src/conversions.jl:844
 in pycall at /Users/colin/.julia/v0.3/PyCall/src/PyCall.jl:416
 in fn at /Users/colin/.julia/v0.3/PyCall/src/conversions.jl:188
 in close_queued_figs at /Users/colin/.julia/v0.3/PyPlot/src/PyPlot.jl:296

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