Conversation
henrikt-ma
left a comment
There was a problem hiding this comment.
It's very nice that this is finally happening!
I would prefer that we set the style now that each figure shall have a caption. I'd rather have a smaller number of models with nice figures, than figures without caption in every model. I would guess that asking an AI to create captions based on existing model documentation and plotted variables would get it mostly right, especially if combined with MSL figure style guidelines to follow.
A style guide should probably also say something about the use of curve legends, and give recommendations regarding (that is, against) variables of incompatible units in the same plot. Requiring that each figure an identifier from start could also be a good idea so that any figure can be referenced from start.
To keep the process simple, I suggest that the figure style guidelines are developed as part of this PR, so that we can iterate on the figures until we are satisfied with the guidelines (assuming that the figures are kept up-to-date with the guidelines).
I believe this file is where the guidelines would belong: https://github.com/modelica/ModelicaStandardLibrary/blob/master/Modelica/UsersGuide/Conventions.mo
|
@henrikt-ma thanks for your feedback, I have some questions:
Developing guidelines is a good idea. I would appreciate a PR prepared by you. |
|
Well, after some tests: More plots in the same figure results in too small plots. Treplaced by more figures. |
I agree that having multiple curves in different units in the same plot is not ideal, but I view it as a trade-off and for this case I preferred having all of them in one plot as before - in particular since:
However, for other examples like Modelica.Electrical.Machines.Examples.ControlledDCDrives.CurrentControlledDCPM it might help to have different figures - as you currently only plot the control signals, and not the actual thing you control (speed for load). We might also consider having non-preferred-figures. Basically we currently have the following options for these signals:
None are ideal, so I could see the following future possibilities:
|
|
@henrikt-ma @HansOlsson
|
|
I can just add that I'm all in favor of adding figure annotations in MSL, and at least one for each example should have @AHaumer we have improved Dymola a little with regards to captions, they are now displayed as a heading at the top of the plot, above the legend. Today you find it by pressing the "?" button in the title bar. |
We have this feature in System Modeler too, and I wouldn't be surprised if there are even more tools with this feature. Given that the feature exists in two or more tools, I agree that standardizing it would be good. Edit: Here's the PR for adding this to the specification: modelica/ModelicaSpecification#3938 |
Yes, no problem.
As others have already suggested, having several figures with one one being a preferred one seems like a good compromise when there are many things to show that would otherwise lead to variables with incompatible units being placed on the same y-axes.
I recommend relying on default behavior unless you have good reasons to take explicit control.
I don't know what to recommend, but I recommend having some sort of recommendation.
You shouldn't; it's up to the tool.
Sure, we can do it this way. |
Done: #4813 |
As decided in MAP-Lib monthly meeting 2026-09-08.