Back Home Up Next

Subchapters:

Exercises histograms

 

Plot histogram of the results in gradelist variable obtained with :

IDL> restore , grades.sav

(the file grades.sav is available at: http://www.astro.virginia.edu/class/oconnell/astr511/IDLexercises/data/grades.sav)

Use histogram IDL function to plot the histogram of the score distribution. Change the bin size and observe the change in the x axis.

Use PLOTHIST (from astro library) to produce a histogram of the scores.

The default bin size in PLOTHIST is always 1.0, regardless of the range of the variable being plotted. Using the BIN keyword, experiment with different bin sizes in the range 1 to 15.

Graphically determine the mode of the scores and note how it changes with binsize. What is the mode for a binsize of 5?

Plot the score histogram for a binsize of 5 with labels for the axes and the plot.

Overplot a vertical line at the location of the median value. (Hint: use the PLOTS command)

Make a hardcopy of the final plot via a PostScript file.

those exercises are from http://www.astro.virginia.edu/class/oconnell/astr511/IDLexercises/

 

IDL courses C. Morisset © 2004 IA/UNAM V 2.2

Back Home Up Next