Skip to content

Update shared axes processing in plot_time_response #1040

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

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

murrayrm
Copy link
Member

This PR updates the way that tickmarks are labeled on shared axes in time response plots, in response to a comment from @slivingston in #1034. Tickmark labels are now omitted on shared axes, consistent with frequency response plots.

To allow tickmark labels to be added, two new keyword arguments are included in time_response_plot: sharex and sharey. These are passthrough arguments to matplotlib.pyplot.subplots and allow axes sharing to be turned on and off in the same way as bode_plot => frequency and time response plots are now consistent.

Also added unit tests checking for consistency and updated the user documentation and relevant docstrings.

Without tickmark labels With tickmark labels
Version 0.10.0:
plot_gallery-0 10 0-2024-06-20
Previous to this PR (from #1034):
plot_gallery-0 10 0-191-g373ff11e-2024-08-08
After this PR (using default settings):
plot_gallery-0 10 0-201-gc9a07c13-2024-08-09
After this PR (using sharex=False):
step_response-sharex_false

@coveralls
Copy link

coveralls commented Aug 13, 2024

Coverage Status

coverage: 94.694% (+0.001%) from 94.693%
when pulling 9c8ffec on murrayrm:tickmark_labels-08Aug2024
into ecf6a38 on python-control:main.

@slivingston slivingston self-assigned this Aug 14, 2024
will force the legacy values (mag, phase, omega) to be returned
(with a warning). To obtain just the frequency response of a system
(or list of systems) without plotting, use the
1. Starting with python-control version 0.10, `bode_plot`returns a
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
1. Starting with python-control version 0.10, `bode_plot`returns a
1. Starting with python-control version 0.10, `bode_plot` returns a

This space is important because without it, Sphinx fails to parse the :class: expression.

Copy link
Member

Choose a reason for hiding this comment

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

After fixing this, the PR is ready to merge.

Copy link
Member

Choose a reason for hiding this comment

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

You may want to commit the figures in the documentation that are affected by this PR.

@murrayrm murrayrm mentioned this pull request Aug 15, 2024
11 tasks
@murrayrm murrayrm merged commit 3e9a39e into python-control:main Aug 15, 2024
23 checks passed
@murrayrm murrayrm deleted the tickmark_labels-08Aug2024 branch August 15, 2024 06:31
@murrayrm murrayrm added this to the 0.10.1 milestone Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants