Skip to content

QOL improvements for plotting#434

Closed
baggepinnen wants to merge 6 commits intoJuliaControl:masterfrom
baggepinnen:nyquist
Closed

QOL improvements for plotting#434
baggepinnen wants to merge 6 commits intoJuliaControl:masterfrom
baggepinnen:nyquist

Conversation

@baggepinnen
Copy link
Copy Markdown
Member

@baggepinnen baggepinnen commented Jan 17, 2021

This PR implements some minor fixes to make plotting nicer. In particular, the weird gain circles in nyquist are replaced for a circle indicating Ms = 2 (default, but can be changed by kwarg).

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 17, 2021

Codecov Report

Merging #434 (a84a3fa) into master (6249cba) will decrease coverage by 0.18%.
The diff coverage is 80.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #434      +/-   ##
==========================================
- Coverage   82.88%   82.70%   -0.19%     
==========================================
  Files          31       31              
  Lines        2857     2873      +16     
==========================================
+ Hits         2368     2376       +8     
- Misses        489      497       +8     
Impacted Files Coverage Δ
src/plotting.jl 78.37% <80.85%> (-1.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6249cba...a84a3fa. Read the comment docs.

@baggepinnen
Copy link
Copy Markdown
Member Author

@JuliaControlBot test-plots

@JuliaControlBot
Copy link
Copy Markdown

This is an automated message.
Plots were compared to references. 3/11 images have changed, see differences below.
After pulling this PR, please update the reference images by creating a PR to ControlExamplePlots.jl here.

Difference Reference Image New Image
⚠️ 0.028 Reference New
✔️ 0.001 Reference New
✔️ 0.0 Reference New

@baggepinnen
Copy link
Copy Markdown
Member Author

Anyone have anything against the cosmetic changes to nyquistplot? The old appearance can be recovered with Ms=1, framestyle = :semi, but I think the defaults here are a bit more useful.

framestyle docs

@olof3
Copy link
Copy Markdown
Contributor

olof3 commented Jan 17, 2021

Definitely improvements

Some thoughts:

Ms = 2 is considered quite high in many circumstances, but it is hard to give a sensible default value. At least 2 is a lot more meaningful than 1, as well as nice and even :). It could be considered to leave it out as default or have a few different Ms circles (not sure how feasible it is to label them).

I would vote for not plotting the circle around the origin as default. It is useful if you would like to eyeball the phase margin, but as one in most circumstances "should" be considering the maximum sensitivity, it is a distraction most of the time.

@baggepinnen
Copy link
Copy Markdown
Member Author

@JuliaControlBot test-plots

@JuliaControlBot
Copy link
Copy Markdown

This is an automated message.
Plots were compared to references. 3/11 images have changed, see differences below.
After pulling this PR, please update the reference images by creating a PR to ControlExamplePlots.jl here.

Difference Reference Image New Image
❌ 0.053 Reference New
✔️ 0.001 Reference New
✔️ 0.0 Reference New

@baggepinnen
Copy link
Copy Markdown
Member Author

baggepinnen commented Jan 19, 2021

New default Ms=1.5, with option to supply a vector of values. Value appears on hover in plotly, couldn't get annotations to work properly. T gain circle removed.

I just noticed that the circles are not plotted in all panes, will get to that..

@baggepinnen
Copy link
Copy Markdown
Member Author

@JuliaControlBot test-plots

@JuliaControlBot
Copy link
Copy Markdown

This is an automated message.
Plots were compared to references. 3/11 images have changed, see differences below.
After pulling this PR, please update the reference images by creating a PR to ControlExamplePlots.jl here.

Difference Reference Image New Image
❌ 0.055 Reference New
✔️ 0.001 Reference New
✔️ 0.0 Reference New

@olof3
Copy link
Copy Markdown
Contributor

olof3 commented Jan 19, 2021

Great!

I realize now that the critical point isn't indicated, a nicely sized red cross would be nice.

There seems to be some inconsistencies in the plot test? Titles and circles.

It feels a little bit weird with Nyquist plots like these for MIMO systems. The MIMO Nyquist criterion is a different thing. But perhaps this could occasionally be useful (not that the MIMO nyquist criterion is overly useful either).

@mfalt
Copy link
Copy Markdown
Member

mfalt commented May 4, 2021

@JuliaControlBot test-plots

@JuliaControlBot
Copy link
Copy Markdown

This is an automated message.
Plots were compared to references. 3/11 images have changed, see differences below.
After pulling this PR, please update the reference images by creating a PR to ControlExamplePlots.jl here.

Difference Reference Image New Image
❌ 0.047 Reference New
✔️ 0.001 Reference New
✔️ 0.0 Reference New

This was referenced May 12, 2021
@baggepinnen baggepinnen deleted the nyquist branch July 11, 2022 16:53
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.

4 participants