GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Legend refactor by leejjoon · Pull Request #26 · matplotlib/matplotlib

Conversation

@leejjoon

@leejjoon leejjoon commented Mar 2, 2011

Copy link
Copy Markdown
Contributor

This is to improve the functionality of legend.
The two biggest changes are

  • Drawing of legend is delegated to "legend handlers".
  • Introduces a new "Container" class. This is primarily to support
    legend of complex plots (e.g., bar, errorbar, etc).

Some more details can be found in the updated legend guide.

http://goo.gl/DhGej

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
leejjoon added 8 commits March 2, 2011 21:09
@leejjoon
Legend refactoring. Drawing of legends is done by LegendHandlers
572ef7e
@leejjoon
Implement artist container, primarily to support the legends of compl…
3991bea
…ex plot commands
@leejjoon
add container.py and revise the bar command to return a container
fe03e22
@leejjoon
legend supports Bar and Errorbar plots
2c99922
@leejjoon
various improvment for legend handlers
c96052e
@leejjoon
update legend demo examples and legend guide
8d5110d
@leejjoon
Axes._get_legend_handles ignores artists with a label of '_nolegend_'
71dad75
@leejjoon
minor api improvement and doc change
5fd689b
@WeatherGod

WeatherGod commented Mar 3, 2011

Copy link
Copy Markdown
Member

I am doing some testing on this branch and I found a broken example: legend_scatter.py now has missing markers in its legend.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@leejjoon
DrawingArea.add_artist do not update artist's transform if already set
1b17994
@WeatherGod

WeatherGod commented Mar 3, 2011

Copy link
Copy Markdown
Member

An interesting bug with respect to hist(). For regular histograms, I think everything is fine. However, for any other type, if the label is provided through the legend() function, the artist for that histogram is skipped and the label goes to the next available artist. However, it works perfectly if the label is provided through the "label" kwarg to hist().

Note that before this, either approaches worked for histograms.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@WeatherGod

WeatherGod commented Mar 3, 2011

Copy link
Copy Markdown
Member

Another bug (or at least a difference in behavior)... for a dragable legend, if I click but not hold down the button, the legend will move with my mouse until I click again. Note that there is also a separate bug where doing this throws a "TypeError: 'instancemethod' object is not iterable", but that doesn't prevent you from continuing and this bug occurs in master as well.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@WeatherGod

WeatherGod commented Mar 3, 2011

Copy link
Copy Markdown
Member

Note that cherrypicking the recent commit to fix draggable legends fixed both problems I just reported.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@leejjoon

leejjoon commented Mar 3, 2011

Copy link
Copy Markdown
Contributor Author

The first issue should be solved by commit 1b17994.

Can you provide an example code for the second issue?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@WeatherGod

WeatherGod commented Mar 3, 2011

Copy link
Copy Markdown
Member

I am using a modified version of histogram_demo_extended.py. After investigating a little further, it appears that the problem occurs for any histogram type that is not patch-based.

I am linking to two versions of the script, one that uses the labels kwarg:
http://dl.dropbox.com/u/7325604/histogram_demo_extended_using_labels.py

and one that uses the legend() function:
http://dl.dropbox.com/u/7325604/histogram_demo_extended_using_legend.py

In particular, figures 1 and 3 are impacted.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@WeatherGod

WeatherGod commented Mar 3, 2011

Copy link
Copy Markdown
Member

Ok, I think I have exhausted all scripts I can find that involves legends and I can only find one other issue (and it isn't new). Stem plots cause a problem because they attach both the dots and the line to the list of collections for legends. So, if I do two stem plots in an axes, and then call legend with two labels, the first label gets black dots, and the second label gets the line for the first stem plot.

However, this is nothing new...

I have not done a code review yet, but in terms of backwards compatibility, it appears that we are (mostly) golden.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@leejjoon

leejjoon commented Mar 6, 2011

Copy link
Copy Markdown
Contributor Author

Regarding the second issue, I think it is related with the current buggy(?) behavior of legend (and the "hist" command relying on this buggy behavior). I posted a related message in the devel-list. The modification of this pull request depends on how this issue is addressed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richbwood richbwood mentioned this pull request Dec 19, 2012
test_pcolormesh hangs #1609
Closed
magnunor pushed a commit to magnunor/matplotlib that referenced this pull request Dec 5, 2013
Stefano Mazzucco
Plot complex images (e.g. FFTs) fixes matplotlib#26
150beb3
lib/drawing/image.py
BUG-FIX: before plotting and image, check if the dtype is complex.
         if so, plot log(abs(data))
         one could argue whether plotting the 'log' or not...

lib/io/dm3_data_plugin.py
MOVE: some 'print' statements commented out
swfiua pushed a commit to swfiua/matplotlib that referenced this pull request Mar 17, 2017
@Ka1lon
Merge pull request matplotlib#26 from swfiua/eric
6c95f21
eric now opens code for current widget
@WeatherGod WeatherGod mentioned this pull request Mar 2, 2018
pyplot hangs at plot() #10648
Closed
@vwood vwood mentioned this pull request Sep 29, 2019
Warnings about bad config (when using default config) #15345
Closed
@lytex lytex mentioned this pull request Jan 2, 2020
matplotlib glitch when rotating interactively a 3d animation #16069
Closed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@leejjoon @WeatherGod
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.