Dymola Command to Maximize or Manipulate Size or Placement of Plot Window - modelica

Is there a command to maximize or manipulate in any way the size and placement of a plot window in Dymola?
After creating a plot using createPlot(), I would like to maximize that window within its allowed area of the screen.
No resource, either online or printed, has indicated how to do this, and none has said it couldn't be done. I am hoping someone can point me to a source that tells me how, or tells me to stop trying.
Here is the entirety of my test script:
simulateModel("TIL_AddOnTraining.Example07a", stopTime=300, method="dassl", tolerance=1e-005, resultFile="Example07a");
createPlot(
id=0,
position={0, 0, 857, 705},
x="valve.summary.dp",
y={"valve.summary.m_flow_A"},
grid=true,
colors={{255,0,0}},
thicknesses={0.7},
autoscale = true
);
[Here is where I would like the command to maximize window called "Plot [0*]".]
Thanks in advance.

Not an answer to the feasibility of doing this in Dymola, but here's a way to create and fine tune plot windows for Modelica using Mathematica and SystemModeler.
Needs["WSMLink`"]
sim=WSMSimulate["HelloWorld"];
plot=WSMPlot[sim,{"x","der(x)"},PlotLabel->"Very Interesting Plot\[Dash]Full Screen"];
CreateDocument[plot,WindowSize->Full]
The setting WindowSize can be changed to different options to select a fraction of the window, full screen, pixel size, and so on.

Related

Matlab: Export a figure made with myaa

I am trying to get better quality phase plots of complex functions made with the Complex Function Explorer of E. Wegert CFE. For this purpose I apply the Matlab anti-aliasing function myaa.m to the phase plots that are made with the CFEGUI.m. For the example screenshot of the result window below I used the setting myaa([8 8]) in the Matlab command window which means that the supersampling enlarge the figure 8x and then downscale it to 1/8 to get the original h x w.
As one can see the window of the figure has no operation icons or menu options for save or print. My question is what to do with such a figure (beside making screenshots)? Can I somehow use export-fig to save such a figure or load it in an image array and if yes, how?
It is also possible to use the setting myaa([8 1]) which results in a very large figure window that is larger than my screen (and has the unpleasant attribute that it can not be moved). It would be even better if such a whole figure could be saved (not only the visible part).
You can use getframe to grab current figure information in pixels.
However, while I do not know how this affects you, notice that MATLAB versions above 2014b (included) have already anti-aliasing. The code you linked seem to be from 2008, I am not 100% sure if it has become obsolete now.

How to display a big figure with mlpd3 inside jupyter notebook?

I am using jupyter-notebook to write some python code and generate figures. As I wanted to add tooltips on mouse hovering and other interactions with the generated graphs, I now use mpld3 to display the graph.
However, as I have quite a lot of things to plot, I need to increase the figure size. So, I putfig = plt.figure(figsize=(20, 10)).
When I display with the standard way, I can see all the figure in my notebook (with horizontal sliders if I increase a bit more the figsize).
But with the mpld3 display, the size of the zone where the figure is displayed seems to be fixed, and hence, I can only see the upper left part of my figure. There are no sliders or anything to increase the displaying zone size.
For example, this code generate a graphic, for which you will see only the upper left part:
fig = plt.figure(figsize=(20, 10))
plt.plot([3,1,4,1,5], 'ks-')
mpld3.display(fig)
Does anyone know how to deal with this ? That is, how to increase the default display zone size, in order to have bigger graphs ?
Thanks
Edit after comment:
Here is a screenshot of how it is displayed on my machine...
And I would like it to be displayed just as it is on yours !
So I guess the problem comes from elsewhere... do you have any idea of how to solve this ?
I hope I do understand your question correctly but in Ipython Notebooks you can only use excisting space and not flip the notebook into wide screen mode or alike. In my notebook the graphic is also displayed like you show.
However, there is an easy fix, simply reduce the figsize to for example (10, 5). The main idea with interactive plotting with mpld3 is that the user can zoom in to specific interesting details. For the presented example it would not make much sense but richer graphs are great to be explored interactively.

how to position Matlab GUI window at top of screen?

I used Matlab GUIDE to create a GUI.
It is displayed mid-screen.
How can I position it at the top of the screen; so that the top edge of the GUI window is at top of screen.
It will be used on different Windows 7 computers with different screen resolutions.
I tried to set hObject.Position(2) but it doesn't do what I want.
I think the simplest way would be to use movegui in the OpeningFcn of your GUI with the appropriate argument, i.e. using either 'north', 'northeast' or 'northwest'.
The calling syntax is quite simple, using the handles to the figure created. In GUIDE, the default name for figures is "figure1", so in your case the code would look like this (unless you changed the figure's name):
movegui(handles.figure1,'northwest') %// or whatever
Note that movegui calls the following 3 functions to get the screen size and monitor positions/units:
screensize = get(0, 'ScreenSize');
monitors = get(0,'MonitorPositions');
old0units = get(0, 'Units');
So you could do the same to make the calculations yourself in order to place the figure precisely where you want if the above solution is not sufficient for you.

Making the MATLAB editor or command window grab focus programmatically

When Matlab is processing code including the plot() command, Matlab will steal window focus, when plot() is processed. While many seem to find this behavior annoying, I find it useful as an alert telling me when the plot has been processed, and I can do something else while Matlab is running.
I would, however, like to have Matlab stealing window focus whenever calculations are done (Matlab being idle), and not just when I include the plot() or figure() command.
I have found a post about disabling the window stealing behavior of plot() and figure() (Inhibit Matlab Window Focus Stealing), but not on adding window stealing behavior when calculations are done. Can it be done?
To make Matlab command window get focus, you can add commandwindow after the calculations. From the documentation,
commandwindow opens the MATLABĀ® Command Window when it is closed, and selects the Command Window when it is open.
To make an existing figure get focus, you can add figure(h), where h is the figure handle. From the documentation,
figure(h) does one of the following [...]
If h is the handle or the Number property value of an existing figure, then figure(h) makes that existing figure the current figure, makes it visible, and moves it on top of all other figures on the screen. The current figure is the target for graphics output.

MATLAB: Changing plotperform window name, and more

So I'm working on some simple neural network problems for a class I'm taking, and I've mostly done all of the work.
However, I'd like to be able to press run and have all of the relevant figures and graphs pop out so I can easily show my work.
To do this I've been drawing setting the names of figures that I plot in using the
figure('Name', 'NameGoesHere', 'NumberTitle', 'off')`
variant of the figure function.
The thing is, one of the things that I have to show are performance graphs for the different networks I made, and using plotperform(tr) sets the window name to Performace (plotperform) even if I try setting the figure name to something else. Any help?
Here's a picture showing what I mean:
Oh, and, being really new to Matlab, correct me if I'm wrong, but since performance is defined as mean absolute error, the lower it is, the better right? So is there a way to set is so plotperform actually selects the lowest point of the graph as the best instead of the first one?
Another thing I'd like to be able to do is have the training information nntraintool open in a new window every time I call the train(netA, P, T) function. Right now, every time it's called it just overwrites the previous info in the nntraintool window. Is it even possible to do this?
This is the window I'm talking about: