-
Create
the 100-element vector Z = 10*X - 0.1*X^2, where X contains the integers
between 0 and 99.
-
Type
PLOT,X,Z. Examine the plot, noting the abscissa, ordinate, and default
scaling adopted.
-
Do
the same for PLOT,X,2*Z. Note the change.
-
Type
OPLOT,X,Z and note what happens
-
Do
the same for PLOT,X,Z^2
-
Do
the same for PLOT,Z^2,X
-
Use
the optional plotting parameters XRANGE and YRANGE with PLOT,X,Z^2 to
enlarge various parts of the plot of the Z^2 function.
-
Plot
log_10(X) vs. Z and X vs. log_10(Z) using the built-in PLOT_OI and PLOT_IO
commands. (Note: you'll have to limit the X,Y scales using the RANGE
parameters to avoid infinities and plot compression. Keep the variable
on the log axis greater than or equal to 1.0.)
-
Label
any of these plots, using the !P.TITLE, !X.TITLE, and !Y.TITLE system
variable strings. All of the plots should have appeared in Window 0.
Try alternating successive plots between Window 0 and Window 1.[NOTE:
The intrinsic IDL routines for manipulating windows are as follows: To
create a new window, use WINDOW,N. To expose or hide an existing
window, use WSHOW,N. To make a given window "active"--- i.e.
ready for I/O---use WSET,N.]
-
Create
the 1000-element vector x, where x contains the FLOATING-POINT conversion of
integer values between -500 and +499. Create Z = 10*X - 0.1*X^2 .
-
Using
PLOT,X,Z explore plotting features as in the previous exercise.
-
Type
PLOT,Z. How does the resulting plot differ from that for PLOT,X,Z?
-
Create
the 1000-element vector X, where x contains the INTEGER values between -500
and +499. Create Y = 10*X - 0.1*X^2.
-
Type
PLOT,X,Y. Why does the Y function differ from Z?
-
Now
define X to contain the integers in the range 0 to 100. Then compute Z
= SIN(X)/X. Is Z a floating point variable?
-
Print
the value of Z at X = 0. If you weren't sure how IDL would respond
there, how would you manually insert a value Z = 0 at X = 0? Do so.
Confirm that the z vector is now defined everywhere.
-
Using
the PSYM and LINESTYLE keywords, plot Z vs. X for integer values of X in the
range 0 to 100:
with a solid line
then
with plus signs
then with open triangles
then with a dashed line
-
Plot
Z vs. X for the X range [0:10] with open triangles. Then, using OPLOT,
add a solid line overplot.
-
You
can achieve the same result with a single PLOT command for your choice of
plotting symbol, K, by using PSYM=-Krather than PSYM=K.
-
Calculate
Z = SIN(X)/X at intervals of 0.01 for X in the range 0 to 10.
-
Plot
Z vs X.
-
Using
the WHERE function, find all the locations where Z has an absolute value
smaller than 0.05. How many are there? Print Z for all those
locations (but only those locations) to your terminal.
-
Plot
Z vs X using a solid line. Now overplot open triangles at those points
you found where Z has an absolute value smaller than 0.05.