X Tutup
Skip to content

Legend not displayed in Plot-Matplot lib #7261

@priyambial123

Description

@priyambial123

Hi,
I am using Enthought Canopy (Version 1.7.4.3348 (64 bit)) and I have downloaded Matplotlib version 1.5-1.5 in Python2.7 (Redhat Linux). I installed Matplotlib package in Canopy using package manager in Canopy. I installed Python2.7 using gzipped file from Python website (https://www.python.org/downloads/). When I run some of the python files for generating a plot, the legend was not displayed in the plot. I got the below warning message:

/home/JPJ/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/legend.py:633: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x7fb6dc346350>] instances.
A proxy artist may be used instead.
See: http://matplotlib.org/users/legend_guide.html#using-proxy-artist

figure_1

This was the code used for generating plot:

p1 = pylab.plot(model.data["B"], 'ob-')
p2 = pylab.plot(model.data["C"], 'sr-')
pylab.legend([p1,p2], ["B","C"])
pylab.ylim((-0.1,1.1))
pylab.show()

Pls find the attached figure, in which the legend is not displayed. Kindly help me with this issue.
Thank you
Priya

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

      X Tutup