X Tutup
Skip to content

Legend tuple handler improve#2904

Closed
tacaswell wants to merge 6 commits intomatplotlib:masterfrom
tacaswell:legend-tuple-handler-improve
Closed

Legend tuple handler improve#2904
tacaswell wants to merge 6 commits intomatplotlib:masterfrom
tacaswell:legend-tuple-handler-improve

Conversation

@tacaswell
Copy link
Copy Markdown
Member

This needs a bit more attention, but useful PR (I came up with a much-less clean way of doing the same thing)

  • needs better doc
  • needs maybe better kwarg name

replaces and closes #2034

@tacaswell tacaswell added this to the v1.4.x milestone Mar 17, 2014
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a docstring to describe these new arguments.

@tacaswell tacaswell force-pushed the legend-tuple-handler-improve branch from 18d5388 to 2e31317 Compare April 19, 2015 18:21
@tacaswell
Copy link
Copy Markdown
Member Author

@WeatherGod Updated

so

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dictionary comprehensions weren't added until py2.7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why didn't Travis pick that up? I thought it went through all examples...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It goes through the examples as part of the doc build, which is probably
not py2.6.

On Mon, Apr 20, 2015 at 11:34 AM, OceanWolf notifications@github.com
wrote:

In examples/pylab_examples/legend_demo5.py
#2904 (comment):

+p1 = ax1.scatter([1], [5], c='r', marker='s', s=100)
+p2 = ax1.scatter([3], [2], c='b', marker='o', s=100)
+
+l = ax1.legend([(p1, p2)], ['points'], scatterpoints=1,

  •           handler_map={tuple: HandlerTuple(ndivide=0)})
    
    +ind = [1, 2, 3]
    +pos1 = [1, 3, 2]
    +neg1 = [2, 1, 4]
    +width = [0.5, 0.5, 0.5]
    +
    +rpos1 = ax2.bar(ind, pos1, width=0.5, color='k', label='+1')
    +rneg1 = ax2.bar(ind, neg1, width=0.5, color='w', hatch='///', label='-1')
    +
    +l = ax2.legend([(rpos1, rneg1)], ['Test'],
  •           handler_map={(rpos1, rneg1): HandlerTuple(ndivide=0, pad=0.)})
    

Hmm, why didn't Travis pick that up? I thought it went through all
examples...


Reply to this email directly or view it on GitHub
https://github.com/matplotlib/matplotlib/pull/2904/files#r28699293.

@WeatherGod
Copy link
Copy Markdown
Member

flash from the past!

Need at least one unit test and a what's new entry. I also don't think the example is all that clear. It could benefit greatly from some comments and/or a top-level docstring.

@tacaswell
Copy link
Copy Markdown
Member Author

This is not at the top of my to-do queue, if anyone wants to take over this PR, please do!

@tacaswell tacaswell added the Difficulty: Easy https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues label May 4, 2015
@tacaswell tacaswell modified the milestones: next point release, proposed next point release Jun 18, 2015
@jmehne
Copy link
Copy Markdown
Contributor

jmehne commented Mar 19, 2016

This PR can be closed (see #5617).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Difficulty: Easy https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

X Tutup