The blog provides study material for Computer Science(CS) aspirants. Mostly says "material nahi milta, padhun kahan se.", I think If you can not find content on the Internet, then you are not a CS student. Dedicated to (Prof. Rakesh Kumar, DCSA, K.U.Kurukshetra, HARYANA, INDIA)- "Ek teacher ka bahut jyada padhna, bahut jyada jaroori hota hai."
Links
▼
Wednesday, 2 October 2013
Plotting
The following images were captured from a visualization of a distillation tower developed for a CAVE VR system:
Commands and Techniques Common to All Plot Types
Generate data in Matlab or load in a data file generated externally
Use the colon operator as needed to extract subsets of data, e.g. columns.
Cropping a plot - Data values of "NAN" ( Not a number ) are not plotted.
Plotting from the Workspace
Right-click on one or more data items and select a plot type from the pull-down menu
When selecting multiple data items, the order of selection is important.
The commands generated are displayed in the command window
- Use help or doc to learn more about them, and copy them into scripts
as necessary.
Plotting using plotting commands
Any of the plot commands can be issued in the command window or from a script.
Porting plots to other documents, e.g. to include in a written report
From plot window, select "File, Save As", and select a file type compatible with your other program, e.g. jpeg
Most plotting commands will use row and column numbers to label the axes if no alternative data is provided.
There is generally a variation that allows you to provide your own data for labeling the axes.
Example: pcolor( x, y, data ) instead of pcolor( data ),
where "data" is a 2-D matrix and "x" and "y" are vectors equal in length
to the number of columns and rows respectively in the data matrix.
Note: Colors can either be represented as
integers ranging from 0 to 255 or floating point numbers ranging from
0.0 to 1.0, and Matlab can sometimes use either one, so it is sometimes
necessary to convert from one data type to the other. ( E.g. im2double
converts an image file from unsigned 8-bit ints ( uint8 ) to doubles.
Subimage:
There is a problem trying to display multiple images with subplot if
the images use colormaps, because a single figure can only use one
colormap. You can get around the problem by using subimage, ( withtin
subplot ), which converts the images to true color, eliminating problems
with colormap conflicts.
Multiple plots on a common set of axes
plotyy - Creates 2 y axes, one along the left edge and one along the right
hold
- Toggles whether the current plot is held for future plotting
commands. ( Used for plotting multiple plots of different types on a
single set of axes, such as a line plot and a bar chart for example. )
Can also be used as "hold on" and "hold off".
"plot" can also plot multiple lines on the same set of axes, as can many other plotting commands.
figure - Create a new figure, make a particular figure active, or bring up the current figure.
Given as a text string of special characters. For example,
"plot( x, y, 'ro' );" plots the x y data using a red line ( 'r' ) and
circles as data markers ( 'o' ).
Shading flat - every polygon is a solid color, with no lines at polygon borders.
Shading faceted - As flat, with black line borders.
Shading interp - Each polygon has a range of color values, smoothly varying from one corner to the next.
( Pcolor ignores the last row and column of data with flat or faceted shading, but uses the values with interpolated shading. )
"view(az,el)" will set the viewpoint for a 3-D graphs as the
azimuth ( polar angle in the x-y plane ) and elevation ( angle above the
x-y plane ) given.
No comments:
Post a Comment