-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Adding example for drawstyle #15011
Conversation
cc @timhoffm |
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. |
Hi @story645 . Exactly in which file(in the path) do I need to include that? |
|
There was a problem hiding this 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=*)
byplot(..., drawstyle='steps-*')
.
@@ -29,6 +29,15 @@ | |||
plt.legend(title='Parameter where:') | |||
plt.show() | |||
|
|||
# The following example demonstrates the drawstyle parameter that can be used |
There was a problem hiding this comment.
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.
@Avni-Sharma Anything you need from us to move this PR forward? |
@tacaswell I shall make the changes by EOD. Apologies for the delay |
…o drawstyle_demo
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! |
Fixes #14724
Adds example for drawstyle parameter.