Matlab's native figure command does not give you an option to make your figure full screen in 1 step. Instead first you have to find the screen resolution and then give your figure command the size of the screen.
First thing you want to do is:
screen_size = get(0, 'ScreenSize');
This will return a 4 element array: (left, bottom, width, height);
The ones we are interested are the "width" and "height".
Now we have the size of the screen, we can make our figure full screen:
f1 = figure(1);
set(f1, 'Position', [0 0 screen_size(3) screen_size(4) ] );
Now you should have a figure that is full screen.
Showing posts with label plotting. Show all posts
Showing posts with label plotting. Show all posts
Monday, June 30, 2008
Wednesday, June 04, 2008
A simple problem with LLNL's VisIt
Recently I found the LLNL's visualization software called VisIt. It has many capabilities and the graphics looked promising from their screenshots. So I wanted to give it a try. However, I had a problem and found the solution with a trial and error way. Since VisIt is developed to be working on distributed systems and parallel systems, it is always using sockets to connect to its server part even you are using them on the same computer.
So when you call the main program with gui,
>visit.exe
It will generate the following commands
Running: "C:\Program Files\LLNL\VisIt 1.9.0\gui"
Running: "C:\Program Files\LLNL\VisIt 1.9.0\viewer" -geometry 1272x1020+408+0 -borders 22,4,4,4 -shift 4,22 -p
reshift 4,22 -defer -host your.hostname -port 5600
Running: "C:\Program Files\LLNL\VisIt 1.9.0\mdserver" -host your.hostname -port 5602
So if you are running it the first time, Windows will ask you to open the ports given above to be unblocked. I unblocked them.
Then suddenly at 32%, mdserver crashed.
After several forum messages and trials, I was still getting the same error.
Later, I installed VisIt to my home computer also and it worked without a problem. Therefore, I started looking for the differences between my two computers. The first and the most obvious difference was with the network connections. At my home computer I had VMWare installed. When you install VMWare, it creates several different network connections, which were enabled by default. Even though they are not real connections, VisIt still handled them according to their IP adresses.
Finally, I disabled all my network connections created by VMWare. Give one more try to VisIt and it started working.
I think the fix will be considered with the next release of VisIt.
So when you call the main program with gui,
>visit.exe
It will generate the following commands
Running: "C:\Program Files\LLNL\VisIt 1.9.0\gui"
Running: "C:\Program Files\LLNL\VisIt 1.9.0\viewer" -geometry 1272x1020+408+0 -borders 22,4,4,4 -shift 4,22 -p
reshift 4,22 -defer -host your.hostname -port 5600
Running: "C:\Program Files\LLNL\VisIt 1.9.0\mdserver" -host your.hostname -port 5602
So if you are running it the first time, Windows will ask you to open the ports given above to be unblocked. I unblocked them.
Then suddenly at 32%, mdserver crashed.
After several forum messages and trials, I was still getting the same error.
Later, I installed VisIt to my home computer also and it worked without a problem. Therefore, I started looking for the differences between my two computers. The first and the most obvious difference was with the network connections. At my home computer I had VMWare installed. When you install VMWare, it creates several different network connections, which were enabled by default. Even though they are not real connections, VisIt still handled them according to their IP adresses.
Finally, I disabled all my network connections created by VMWare. Give one more try to VisIt and it started working.
I think the fix will be considered with the next release of VisIt.
Export figures in Matlab without displaying them
Assuming you have a lot of figures to plot, but you do not want to wait and see them in Matlab's figure window. There is a way you can export all of your figures without displaying them. This might also save you some time, since you are drawing them on the screen.
Here is how :
% Create a figure with visibility off
f = figure('Visible','off');
% Then do your plot
plot
% Finally export the plot as an image
print('-dpng', 'test.png');
You can also make this in a loop (Which is very probable if you have too many figures).
Do this
for i:1, n
f = figure('Visible','off');
plot
filename = sprintf('plot-%d',i);
print('-dpng', filename);
end
This will give you 'n' png images with your plots in it.
Here is how :
% Create a figure with visibility off
f = figure('Visible','off');
% Then do your plot
plot
% Finally export the plot as an image
print('-dpng', 'test.png');
You can also make this in a loop (Which is very probable if you have too many figures).
Do this
for i:1, n
f = figure('Visible','off');
plot
filename = sprintf('plot-%d',i);
print('-dpng', filename);
end
This will give you 'n' png images with your plots in it.
Saturday, January 26, 2008
Very useful Gnuplot information

If you need a free and a powerful plotting program Gnuplot would be a good choice for you.
Especially if you are working on a Linux system, you might find many additional utilities making your life easier with Gnuplot.
Without the GUI front ends it will behave more like a command prompt. Also it is capable of reading script type of files and act accordingly.
There are a lot of good Gnuplot tutorials and help pages all over the internet. However, I think this page (not so Frequently Asked Questions) about Gnuplot goes beyond the regular help pages. There are many specific cases, but there are also many generic help.
You can even plot a butterfly with Gnuplot :). (generated using this script from Gnuplot website)
Enjoy your plots...
Wednesday, January 16, 2008
Maximum zone limit in Tecplot
To change the maximum number of zones used in Tecplot ASCII data files, the limits might need to be changed. The limit can be changed with:
$!LIMITS
MAXPREPLOTZONES = (Number)
The change has to be added to the Tecplot configuration file.
Subscribe to:
Posts (Atom)