BookmarkSubscribeRSS Feed
Lapis Lazuli | Level 10

I have count data for an X-Y coordinate system over time. I would like to display it using a heat map that is an animated gif file where the animation scrolls thru the time axes.

I found this example (as well as a bunch of others):

But I have been unable to get it to produce an animated GIF.

Is this even possible?

And if so, any suggestions on how to make it work?

If not, any other suggested approaches to do this?


Don H

Meteorite | Level 14

I guess this is a 2-part question.

For the first part, exactly what would you like your "heat map" to look like? Could you show an example?

For the 2nd part (animation), here are several examples:

Robert Allison's SAS/Graph Samples!</title><link rel=File-List href="index_files/filelist.xml"><link...

Also note that in 9.4, the syntax for creating gif animations was made simpler ... so if you've got 9.4, then you can take advantage of that Smiley Happy

Robert Allison's What's New in V9.4 SAS/GRAPH...

Meteorite | Level 14

See my blog article on gif animatiion using SGPLOT.  You can use GTL and SGRENDER for the graphics part for heatmap.  The animation code will be similar.

Note, to keep the color mappings constant through the animation, I suggest using the RangeAttrMap to control the mapping of color to response values..

Lapis Lazuli | Level 10

Thanks Robert and Sanjay. These look like they will do exactly what I want.

And Rob, I do have 9.4 and so I can take advantage of the simpler syntax. In looking at both of your responses I recognize that my attempts did not work as I was using Jurassic SAS/Graph options to try and do this.

I have a fair amount of data management work to do before I have the data for this. Now that I know I can do an animated heat map the structure of the output data set will likely be tweaked a bit.

I will post an example of the output once I have gotten things working.

Thanks to both of you for your incredibly helpful and quick responses.

Don H

Lapis Lazuli | Level 10


Hope you don't mind another question. Using the template code from the line in my original question, and with the changes you both suggested, I now am able to produce an animated gif (attached). It got it to work both with a by variable as well as via macro looping.

This is geospatial (latitude X longitude buckets) over time. Latitude and Longitude are the x,y coordinates and time is the by variable. I would like to have the same colorresponse shown regardless of the by group. But I can't see how to do that.

Is it possible to do that? And if so, can you point me in the right direction?


Don H.

PS, in the editor, the animation of the gif file is used. But once the message was posted it was gone. If you want to see the animation you have to right click and open in new window.


Meteorite | Level 14

Did you create the graph using GPLOT or GTL?  If GTL, you can use the RangeAttributeMap such that it will be consistent for all the values across all the time steps.  This is what I alluded to in my earlier reply.

Lapis Lazuli | Level 10

I used GTL and I think I must have confused RangeAttributeMap with another option as what I looked at appeared to be for discrete values instead of continuous ones. I found the doc for RangeAttributeMap and it looks like it will do what I need.

Thx again!!!!!

Meteorite | Level 14

Yes, GTL also has a DiscreteAttributesMap.  Smiley Wink

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 3 in conversation