Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legend not displayed #7508

Closed
priyambial123 opened this issue Nov 24, 2016 · 1 comment
Closed

Legend not displayed #7508

priyambial123 opened this issue Nov 24, 2016 · 1 comment

Comments

@priyambial123
Copy link

Hi,
I am using Python 2.7 in Enthought Canopy environment (Version: 1.7.4.3348 (64 bit)). I have installed Matplot lib (version 1.5-1.8) from package manager in Canopy.I have installed all these packages in RedHat Linux system.

I am not able display the legend when I run the Python script (attached as text file). I get this message: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x7f6312630d50>] instances.
A proxy artist may be used instead.

It will of great help, if someone can help me to fix this problem.
migration-plot.txt

Thank you

Regards
Priya

@Kojoley
Copy link
Member

Kojoley commented Nov 24, 2016

    ps = [ plot( Migration1, 'bo-' ), plot( Migration2, 'ro-' ), plot( DISC, 'b^-' ), plot( DISC2, 'r^-' ) ]
    legend( ps, 'Migration DISC1'.split() , loc='lower left' )

plot call returns a list, so ps is a list of lists and this is the problem. Solution for you is to flatten ps.

@Kojoley Kojoley closed this as completed Nov 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants