Skip to content

Adapt stem plot #10165

Closed
Closed

Description

@timhoffm

Proposed changes

Inspired by the example stem plot.

1. Z order

Currently the stems are on top of the markers. This is in agreement with the MATLAB behavior http://de.mathworks.com/help/matlab/ref/stem.html#btrw_xi-94

However, it looks a bit untidy. I propose to place the markers on top.

2. Example coloring

The example cycles through the stem colors. IMO this is an untypical use case. The example (in particular if we just have one) should show a typical diagram. Therefore, we should change it to just one stem color.

Activity

  1. anntzer commented on Jan 4, 2018

    @anntzer
    Contributor

    I would also argue that it should be considered a bug that ax.stem([1, 2]) does not cycle the colors but ax.stem([1, 2],"-.") does... not sure if #9565 helps with that.

  2. AdamsonMA commented on Feb 4, 2018

    @AdamsonMA

    I've also found that the lines overlapping the markers looked untidy. My solution was to create a new pyplot method for personal use that allows users to re-order which items appear on top when plotting. I would be glad to share the code if this issue is still open!

    An example of the reordered plot:
    image

  3. timhoffm commented on Feb 4, 2018

    @timhoffm
    MemberAuthor

    It seems that #9565 (comment) also fixes the z-order. To prevent duplicate work, I wouldn't do anything here until the above is merged.

  4. jklymak commented on Feb 4, 2018

    @jklymak
    Member

    I mildly disagree about the zorder. Its easier to pick off a precise number when a solid line ends at the end to the stem.

  5. timhoffm commented on Mar 17, 2019

    @timhoffm
    MemberAuthor

    Ok, let's keep the zorder.

    The example coloring is adapted in #13687.

  6. added this to the v3.1.0 milestone on Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions