| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| Striped lines (experimental) | ||
| ---------------------------- | ||
|
|
||
| New *gapcolor* parameter enables the creation of striped lines. | ||
|
|
||
| .. plot:: | ||
| :include-source: true | ||
|
|
||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
|
|
||
| x = np.linspace(1., 3., 10) | ||
| y = x**3 | ||
|
|
||
| fig, ax = plt.subplots() | ||
| ax.plot(x, y, linestyle='--', color='orange', gapcolor='blue', | ||
| linewidth=3, label='a striped line') | ||
| ax.legend() | ||
| plt.show() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -304,6 +304,17 @@ def test_marker_as_markerstyle(): | |
| assert_array_equal(line3.get_marker().vertices, triangle1.vertices) | ||
|
|
||
|
|
||
| @image_comparison(['striped_line.png'], remove_text=True, style='mpl20') | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityInterestingly, remove_text does not apply to legend. (Should be investigated at some point). Still, I propose not to pick up text in the reference image. Do you want the legend entries as a test that the lines are drawn correctly there? If not remove the legend, if yes use label=' '.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@oscargus asked for the legend so I guess he wanted to check the legend lines are drawn correctly.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityCorrect! Completely happy without text!
Sorry, something went wrong.
rcomer and timhoffm reacted with thumbs up emoji
All reactions
|
||
| def test_striped_lines(): | ||
| rng = np.random.default_rng(19680801) | ||
| _, ax = plt.subplots() | ||
| ax.plot(rng.uniform(size=12), color='orange', gapcolor='blue', | ||
| linestyle='--', lw=5, label=' ') | ||
| ax.plot(rng.uniform(size=12), color='red', gapcolor='black', | ||
| linestyle=(0, (2, 5, 4, 2)), lw=5, label=' ', alpha=0.5) | ||
| ax.legend(handlelength=5) | ||
|
|
||
|
|
||
| @check_figures_equal() | ||
| def test_odd_dashes(fig_test, fig_ref): | ||
| fig_test.add_subplot().plot([1, 2], dashes=[1, 2, 3]) | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.