8000 Adding example for drawstyle by Avni-Sharma · Pull Request #15011 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Adding example for drawstyle #15011

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

Closed
wants to merge 5 commits into from

Conversation

Avni-Sharma
Copy link

Fixes #14724

Adds example for drawstyle parameter.

@Avni-Sharma
Copy link
Author

cc @timhoffm

@story645
Copy link
Member
story645 commented Aug 8, 2019

Thanks for the PR! Can you please do what @timhoffm suggested in the issue and make this a section of the https://matplotlib.org/gallery/lines_bars_and_markers/step_demo.html example.
(And sorry for the close, that was just my finger slipping on my phone)

@story645 story645 closed this Aug 8, 2019
@story645 story645 reopened this Aug 8, 2019
@Avni-Sharma
Copy link
Author

Hi @story645 . Exactly in which file(in the path) do I need to include that?

8000

@timhoffm
Copy link
Member
timhoffm commented Aug 9, 2019

examples/lines_bars_and_markers/step_demo.py

Copy link
Member
@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

  • Your example is failing. Please test your examples before committing them.

    Unexpected failing examples:
    /home/circleci/project/examples/lines_bars_and_markers/step_demo.py failed leaving traceback:
    Traceback (most recent call last):
      File "/home/circleci/.local/lib/python3.7/site-packages/sphinx_gallery/gen_rst.py", line 480, in _memory_usage
        out = func()
      File "/home/circleci/.local/lib/python3.7/site-packages/sphinx_gallery/gen_rst.py", line 465, in __call__
        exec(self.code, self.globals)
      File "/home/circleci/project/examples/lines_bars_and_markers/step_demo.py", line 37, in <module>
        _ = ax.plot(x, y, drawstyle='steps-post')
      File "/home/circleci/project/lib/matplotlib/axes/_axes.py", line 1645, in plot
        lines = [*self._get_lines(*args, data=data, **kwargs)]
      File "/home/circleci/project/lib/matplotlib/axes/_base.py", line
    8000
     216, in __call__
        yield from self._plot_args(this, kwargs)
      File "/home/circleci/project/lib/matplotlib/axes/_base.py", line 342, in _plot_args
        raise ValueError(f"x and y must have same first dimension, but "
    ValueError: x and y must have same first dimension, but have shapes (130,) and (14,)
    
  • Please make sure the code is PEP8 compliant (use space in tuples and parameter lists).

  • There is no need to assign the return values to _.

  • From the didactic point of view, I would just state:

    The same can be achieved using plot(..., drawstyle='steps-*'):

    Then copy the example code and replace steps(..., where=*) by plot(..., drawstyle='steps-*').

@@ -29,6 +29,15 @@
plt.legend(title='Parameter where:')
plt.show()

# The following example demonstrates the drawstyle parameter that can be used
Copy link
Member

Choose a reason for hiding this comment

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

Please add a line of '#' to begin a new sphinx gallery section and make this render as html, not as comment in the code. Compare also the references block bleow.

@tacaswell
Copy link
Member

@Avni-Sharma Anything you need from us to move this PR forward?

@tacaswell tacaswell added this to the v3.3.0 milestone Aug 12, 2019
@Avni-Sharma
Copy link
Author

@tacaswell I shall make the changes by EOD. Apologies for the delay

@timhoffm
Copy link
Member
timhoffm commented Oct 3, 2019

Since this did not move for some time and there were still some issues to be fixed, I decided to pick it up along with some other things in #15372. @Avni-Sharma thanks for your contribution!

@timhoffm timhoffm closed this Oct 3, 2019
Sign up fo 6BBB r free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drawstyle parameter of line needs example
5 participants
0