Changeset 10993:fe87a93d7c19 in orange


Ignore:
Timestamp:
10/01/12 19:03:06 (19 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Children:
10994:d93e616812c5, 11095:9a01e272802c
Message:

Unwarp the matplotlib Line2D items for the call to 'legend()' in 'plot_evimp'.

Fixes #1232.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/regression/earth.py

    r10953 r10993  
    10241024    imp = numpy.array(imp) 
    10251025    X = range(len(attrs)) 
    1026     l1 = axes1.plot(X, imp[:, 0], "b-",) 
     1026    l1 = axes1.plot(X, imp[:, 0], "b-", label="nsubsets") 
    10271027    axes2 = axes1.twinx() 
    10281028 
    1029     l2 = axes2.plot(X, imp[:, 1], "g-",) 
    1030     l3 = axes2.plot(X, imp[:, 2], "r-",) 
     1029    l2 = axes2.plot(X, imp[:, 1], "g-", label="gcv") 
     1030    l3 = axes2.plot(X, imp[:, 2], "r-", label="rss") 
    10311031 
    10321032    x_axis = axes1.xaxis 
     
    10371037    axes2.yaxis.set_label_text("normalized gcv or rss") 
    10381038 
    1039     axes1.legend([l1, l2, l3], ["nsubsets", "gcv", "rss"]) 
     1039    axes1.legend((l1[0], l2[0], l3[0]), ("nsubsets", "gcv", "rss")) 
     1040 
    10401041    axes1.set_title("Variable importance") 
    10411042    fig.show() 
Note: See TracChangeset for help on using the changeset viewer.