hallchart(): fix and improve it
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION
---------------
As from its introduction in Scilab 5.3.0 and up to now in 6.0.2, hallchart() is quite bugged and poor:
A) Since Scilab 5.5, when it is called AFTER another drawing function like nyquist, etc
hallchart() imposes its data bounds, instead of keeping existing ones.
(this this due to xpoly() that now resizes the axes accordingly).
Compares the last (nyquist) plot on
https://help.scilab.org/docs/5.4.1/en_US/hallchart.html
versus
https://help.scilab.org/docs/5.5.1/en_US/hallchart.html
This should be fixed.
B) As it can be seen still @ https://help.scilab.org/docs/6.0.2/en_US/hallchart.html
for the default chart (but as well for other charts),
1) All labels of modules > 0 are displayed around the center of the chart
in a crowdy way, instead of along circles in a symetric way as for modules < 0.
2) The location of labels is sometimes misleading. For instance on the hallchart()
visible at https://help.scilab.org/docs/6.0.2/en_US/hallchart.html
o For 45 60 90° labels and curves, who is who is unclear
o For -20 -10 (and -6) dB labels and curves, same thing.
The placement of labels must be more accurate.
3) The major external part of the chart is poorly framed.
- Frames for modules = -3 -2.5 2.5 and 3 dB could at least be added
- Frames for phases = -20 -12 12 and 20° could at least be added.
4) In order to see labels as well for external fractional arcs, a placement
along diagonals should be preferred.
All this should be fixed.
C) If format("e") is enabled, all simple modules labels are displayed in exponential form.
This should be fixed. Try: --> format("e"), hallchart()
D) Frames colors can't be specified in an handy and absolute way with colors names or #RRGGBB,
without respect to the current colormap.
This should be fixed.
E) Customization and post-processing of the frames and labels is uneasy/unhandy, for instance
to choose different colors for frames and labels, change the thickness of frames, etc.
Returning a structure with 4 fields
.phaseFrame: vector of handles of isophase lines.
.phaseLabels: vector of handles of isogain labels.
.gainFrame: vector of handles of isogain lines.
.gainLabels: vector of handles of isogain labels.
This would uncouple the addressing of handles from their actual technical hierarchy,
that can be unchanged (for back-compatibility).
F) A dedicated report could be posted later to improve both following points:
1) An automatic mode choosing the default set of modules and phases according to
existing data bounds could be implemented later.
2) In addition, avoiding the crowdy plot around the center would be nice,
automatically selecting a subset of lines to plot around the center.
ERROR LOG:
----------
None.
HOW TO REPRODUCE THE BUG:
-------------------------
See the help pages and the above description.
OTHER INFORMATION:
------------------
Similar improvements required for nicholschart(): bug 15393 => https://codereview.scilab.org/19819