Session 5, #6: Additional Challenges: Shading by Magnitude
Where an earthquake occurs is one piece of information collected. Another is the magnitude, the size based on the quantity of energy released (measured on the Richter Scale). For the USGS data files, magnitude is stored in the fourth column.
Let's use color to indicate the magnitude of the quake. We will set the red to be the magnitude times 40 (since magnitudes usually range from near 0 to about 6, but colors range from 0 to 255). For example,
- if the magnitude is 0.5, then the amount of red shown will be 0.5 * 40 = 20 (very dark red).
- If the magnitude is very large number like 6.0, then the color will be 6.0 * 40 = 240 (a very bright red).
The Python code is:
teddy.color(mag*40, 0, 0)
Remember colors can be specified by (Red, Green, Blue) values.
Challenges:
• Change teddy to be circular or turtle shaped to make the earthquakes more visible on the map.
• Change the coloring from shades of red to shades of purples.