- This topic has 3 replies, 2 voices, and was last updated 2 years, 6 months ago by Jonathan Sandoe.
-
AuthorPosts
-
MaryParticipant
I am mapping temperatures along streets in my city by collecting temperature and location using a PocketLab app. I would like to color code specific ranges, e.g.
- 50-60 degrees Fahrenheit would be blue
- 60-70 would be green
- 70-80 would be yellow
- 80-90 would be orange
- 90-100 would be red
Any suggestions?
May 1, 2022 at 1:50 am #6978Jonathan SandoeKeymasterIt’s definitely not a beginner data move, but it can be done. Someone else may have a better way of doing this in CODAP, but here is mine.
1. First we have to create the categories for the different temperature ranges. In the Case Table create a new attribute, like “temp-range”.
2. Create a formula for ‘temp-range’ that creates a categorical value for each temperature. It’s a complicated looking formula, but it boils down to a repetition of a simple idea: “if(temp<60, ‘cold’, if(temp<70, ‘chilly’, if(temp<80, ‘moderate’, if(temp<90, ‘warm’, ‘hot))))”
3. Now open a graph and drag “temp” to the x axis and drag “temp-range” to the middle of the graph. You should see the dots in the graph with different colors assigned to each category, but probably the wrong colors.
4. Now open the “paintbrush menu” in the graph. This menu will permit you to assign your desired color to each of the possible values of ‘temp-range’.
5. If the data set has latitude and longitude assigned to each case, when you open the map, the points will be colored appropriately.
Hope this makes sense to you.
— Jonathan
May 10, 2022 at 8:27 pm #6982MaryParticipantJonathan–Sorry for the delayed response. I was away for a while and am not experienced with the necessary terminology (such as Case Table, category, attribute) or actions (creating a formula, assigning desired colors to each of the possible values) but I want you to know that I really appreciate your suggestions and tried to do what you suggested. I found that it was possible to guess my way through some of it: encouraging! But I continue to need help color coding data points on maps.
Specific problems:
- I believe that I successfully created the new attribute “temperature ranges” in the case table. However, when I attempted to create a formula that creates a categorical value for each temperature, I simply copied and pasted your formula as one whole entity. I eliminated some of the parentheses. I received the message “syntax error”. As an aside, I would like to have each temperature category have a range of 5 degrees, not 10. We’ll be doing our official data collection and mapping in our hottest months, July and August, when temps will range from 60-105.
- I opened a graph and dragged “temp” to the x-axis, but I wasn’t able to drag “temp range” to the middle of the graph. (Is that still good news?) I got a graph with different colors similar to the colors I got on the original CODAP map. However, I was unable to use the paintbrush menu to assign new colors to each of the possible values of temperature range.
Thank you for considering these questions,
Mary Maxfield
May 10, 2022 at 8:59 pm #6983Jonathan SandoeKeymasterHello Mary,
I am glad you were able to guess your way through some of my instructions. BTW, there are videos on our “help” website that may remove some of the guesswork. It sounds like the “syntax error” is the main roadblock. This could be caused by unbalanced parentheses. Since you may need to modify the document as you use it with students it will be really important for you to feel comfortable with formulas, and specifically the “if” function. If you work with spreadsheets, you may know there is an “if” function there as well. It is very similar. The condition is the first argument. The second argument is the value if the condition is true. The third argument is the value if false. These can be compounded. The second or third argument could themselves contain if functions.
I suggest you start simple. Replace the formula with a simple if function, like ‘if(temp<100, “cool”, “hot”)’. That will put “hot” or “cold” in each cell of the column. Then you can complete the rest of the procedure I outlined. If that works you can modify the formula by wrapping the function in more ‘if’ functions, making sure to balance the parentheses.
Hope this helps.
Jonathan
-
AuthorPosts
- You must be logged in to reply to this topic.