# PHYCS 3730/6720 Lab Exercise

#### Exercise 1. Scatter plots

Exercise and data courtesy Benjamin Bromley.

A file ~p6720/examples/lcrs/lcrs.e_gax contains a list of galaxy data (v_r [km/s], theta [radians], phi [radians], Mag [absolute magnitude in broad-band red light]) from the Las Campanas Redshift Survey. As in Assignment 1, Ex. 3, treat the recession velocity v_r as a radial coordinate, so that (v_r, theta, phi) are standard spherical polar coordinates.

Use gnuplot to make a 2-D map of the galaxies in space, with each galaxy represented by a single dot. Tip: in the file name gnuplot doesn't understand the tilde abbreviation ~, so to read the file, you'll need to spell it out like this: /u/course/p6720/examples/lcrs/lcrs.e_gax. The galaxies all lie in a "survey volume" that is roughly shaped like two curved pizza slices with their pointed-ends touching at the origin. Make a plot with the x and y values as follows:

```x = v_r*cos(phi)*sin(theta) and y = v_r*sin(phi)*sin(theta);
```
This transformation converts the data from spherical polar coordinates to rectangular coordinates and projects onto the x-y plane. Label both the axes of the map in these new coordinates to say "km/s". [Hint: see the "set xlabel" command.] Choose the point size to be 0.05 so you can see the detail in the scatter plot. Then set up gnuplot so that it writes your plot to a postscript file called gax.ps. Finally, put all the relevant gnuplot commands into a text file called gax.gpl (you can use emacs or gnuplot's save utility). The objective is to be able to create the postscript file with the single command gnuplot gax.gpl. There is no need to copy the data file to your accounts; use the absolute path given above to reference the file.