Is it possible to print out the state space using SPIN? - visualization

I would like SPIN to print out the computed state space, so that I can make its visualization and then manually explore it. Is that possible?
I have already checked such flags as -DCHECK and -DVERBOSE, but I guess, that those are not what I am looking for...

No, currently there is no graphical output of the searched state space in spin. It is possible to plot the program graph using graphviz dot, as described here.

Related

No support for custom shapped windows in gtk3?

I want to use a custom shaped window using gtk3. I found gtk_widget_shape_combine_mask_() in gtk2. The closest thing I can find in gtk3 is gdk_window_shape_combine_region_(), which only allows for rectangular shaped regions. Why was the support dropped? Or was it changed and implemented in a different way?
What do you mean with "why was the support dropped?".
gtk_widget_shape_combine_mask() only supports rectangular shapes, too. That's what a GdkBitmap is: An image with a bit depth of 1. This means that a pixel is either included or not.
This is basically the same as a cairo_region_t. The difference is only in how the data is stored: Instead of a bitmap, cairo_region_t uses a list of rectangles to describe the same result.
"Or was it changed and implemented in a different way?"
Yes and you already found the replacement yourself.

Google Charts trendline y-intercept

I've been trying to force a trendline through 0,0 for my scatter graph, but I can't seem to find a way to do this.
From the docs here, they don't give any information on it: https://developers.google.com/chart/interactive/docs/gallery/trendlines
But, I know there are lots of undocumented stuff in charts.
This is an example of what i am trying to do within Google charts(Done within excel)
The red dotted liner is the trendline, on the left is the default liniear regression that Google charts can give, but in many situations you would want to force a Y-intercept, in this example its forced to be at 0
No, you should NOT need values to force an intercept. This is a pretty standard option in graphing programs. Unfortunately, I don't see where Google Sheets gives you the option, which is one reason I don't recommend it for serious data analysis.
It's odd that the LINEST function allows you to force a zero Y-Intercept, but the trend-line tool in the Chart Editor does not. Excel offers a checkbox to force the line through the origin. (Of course, one should exercise caution when doing so. You really have to know something about the data your analyzing.)

Bad clarity using export_fig

I am using Export_fig to export figs from matlab, I am getting very good plots generally. But when i add some textboxs and arrows in the fig. the clarity is pathetic.
I use the -transparent property, which does not work either.
export_fig('path', '-pdf','-transparent')
Anyone knows what is happening here. Normally this works very good, only when the text is added it acts like this way. Not sure if it's a glitch in the code or if i am doing anything wrong.
Note: I added the text and arrows with insert option on the menu bar.
If you are not set on using Export_fig for other reasons, consider using MATLAB's built-in print function and increase the resolution with the -r attribute
print('path', '-dpdf', '-r300')
where 'path' is the desired 'path\filename.pdf', '-dpdf' sets the file type, and '-r300' sets the resolution to 300 dpi, also try '-r0' for screen resolution, or higher, till you get what you want.
I'm not sure what the '-transparent' argument is used for but there is probably an equivalent you can find in the documentation.
https://www.mathworks.com/help/matlab/ref/print.html

How to make a DEM in QGIS using spot heights and contors

I have 2 shapefiles. One is the contors of an area and the other the spot heights. Both of them has a altitude attribute. In ArcGIS there is a tool called topo to raster were you can use both these features to create a dem. In qgis I have only found tools were you can only use one.
Any Ideas?
There is only the interpolation tool that I know of which will create a DEM. Depending on the resolution you're after, you could BUFFER the spot heights, then MERGE SHAPE FILES and run the interpolation tool on that.
Using the graphical modeler would prevent the buffer layer being created making the process a little tidier (and i'm sure there's a better way using the python console). Hope this helps.

How to print figure to clipboard by PRINT function with the quality identical to 'Edit-->Copy Figure' option?

Is there any way to print the figure to the clipboard so that the quality is identical to what the Edit-->Copy Figure option provides?
I used to save the figure to powerpoint file by using saveppt.m obtained from Matlab Central. It worked well until yesterday. I noticed that the stored image quality was somehow degraded. I tried to re-generate some ppt slides with exactly the same script and the same source data, but the new slides are simply of worse quality.
I investigated into this problem a little bit and discovered that when the figure is copied to clipboard by running print -dmeta, the image in the clipboard is already degraded, while if I use the Edit-->Copy Figure option in the figure window, I get the image as clear as the original image in the figure window.
Following is an example for your reference. I copied the image from a figure to the clipboard by two different methods, and paste it to Microsoft Paint program, and cut a piece of it to show below:
The image using print -dmeta:
The image using Edit-->Copy Figure:
If you compare the Xtick label '50', you may see that the image from Edit-->Copy Figure is smoother.
At the beginning I thought it was a problem of the resolution, but setting -rN to change the resolution does not seem to resolve my problem, at least not for N<=300.
Thank you for your help.
The short answer... Use the same function invoked in the callback for that menu item:
editmenufcn(gcf,'EditCopyFigure');
The longer answer... How exactly did I find this? You can look at my previous answer to a related question about reproducing what is done by a File menu option. The concept is the same, just for a different figure menu. For example, this will find the callback you want for the currently active figure window:
>> hCopyFigure = findall(gcf,'Label','Copy &Figure'); %# Handle for the "Copy
%# Figure" menu item
>> get(hCopyFigure,'Callback') %# Callback invoked when that item is selected
ans =
editmenufcn(gcbf,'EditCopyFigure')
The function EDITMENUFCN is another one of those sparsely documented functions, but looking through the code (by typing edit editmenufcn.m) shows that it either invokes Java (if you're on a Mac) or the undocumented function UIMENUFCN.
I think I found the answer myself. Using print -dmeta -painters to specify the renderer resolves my problem.
In File-->Preference-->Figure Copy Template-->Copy Option I noticed there are 3 options:
Metafile
Preserve information
Bitmap
I found that if I select 1, the Edit-->Copy Figure outputs the same image as print -dmeta. So I kind of confirmed the information I need is in the Preserve information option. A quick google search led me to the discussion about the potential difference of the applied renderer, and eventually I confirmed that using painters will print the image to the clipboard in the way I wanted.
The image in the question seems to be generated by the renderer zbuffer and painters, respectively. I still don't know why the default renderer of paint -dmeta changes, though.