Ticket #10847: trac_10847-reviewer.patch

File trac_10847-reviewer.patch, 1.2 KB (added by kcrisman, 9 years ago)

Attach after main patch

  • sage/plot/matrix_plot.py

    # HG changeset patch
    # User Karl-Dieter Crisman <kcrisman@gmail.com>
    # Date 1300108791 14400
    # Node ID 66048f26316334c2e7199124a56092785ce87da0
    # Parent  9a7f11051859556d60fb07cdb01d9aeb183fe7d7
    Trac 10847 - delete subdivision options for sparse matrices before plotting
    
    diff -r 9a7f11051859 -r 66048f263163 sage/plot/matrix_plot.py
    a b  
    198198        if hasattr(self.xy_data_array, 'tocoo'):
    199199            # Sparse matrix -- use spy
    200200            opts=options.copy()
    201             for opt in ['vmin', 'vmax', 'norm', 'origin']:
     201            for opt in ['vmin', 'vmax', 'norm', 'origin','subdivisions','subdivision_options']:
    202202                del opts[opt]
    203203            if origin=='lower':
    204204                subplot.spy(self.xy_data_array.tocsr()[::-1], **opts)
     
    384384        Traceback (most recent call last):
    385385        ...
    386386        ValueError: can not convert entries to floating point numbers
     387
     388    Test that sparse matrices also work with subdivisions::
     389
     390        sage: matrix_plot(sparse, subdivisions=True, subdivision_boundaries=[[2,4],[6,8]])
    387391    """
    388392    import numpy as np
    389393    import scipy.sparse as scipysparse