cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
claude_bellavan
Level III

Graph Builder heat map: how to share the same scale for all years?

Hi

I want to show the spread and growth of the population over time and space. I’m using Graph Builder to map population density (see below). I can produce quite nice heat maps but the density seems to be calculated separately for each year. Is there a way to share the same scale for all years so the colours will have the same meaning across maps?

Thanks.

C.B.

10739_HeatMap population.png

7 REPLIES 7
txnelson
Super User

Re: Graph Builder heat map: how to share the same scale for all years?

The solution that I have come up with, that approximates the solution you want, is to create a data table that has concatenated to it, a copy of the complete data table for each of the years.  For the first of the concatenated copies, you set the year value to the first year in your data table, then for the second, you set it equal to the second year, etc.  For each of the concatenated copies, you set the rowstate to Hide.  The end result of this is that for the calculation of the density, all of the data will be used, but the individual data points will not be displayed.  Only the rows from the original table, which the rowstate is not hidden or excluded will be displayed.

The above solution can be made more exact, if the first of the concatenated data tables contains all of the rows from the original data table, except for the first year, the second concatenated table has all of the rows except for the second year, etc.  It is a bit more complex to produce but marginally more accurate.

Jim
claude_bellavan
Level III

Re: Graph Builder heat map: how to share the same scale for all years?

Thank you very much txnelson. I'll try this solution.

C.B.

claude_bellavan
Level III

Re: Graph Builder heat map: how to share the same scale for all years?

Hi,

I'm afraid the solution doesn't work with the density (Contour). In this example, we can see that hiding rows state is working with dots, but the density is the same for both years (no evolution at all).

10757_Density_ Contour.png

Without hiding concatenated rows :

10758_Density_Contour_all_rows.png

I followed instructions very carefully. Maybe I missed something.

Thanks again.

C.B.

txnelson
Super User

Re: Graph Builder heat map: how to share the same scale for all years?

You did an excellent job at following my instructions.  But I did a poor job of interpreting what you wanted.  I thought you wanted the overall density displayed on all maps.

As far as adjusting the scale, I am not aware of any way to set the scales, however, if you use the Contour Plot platform, under Graphics==>Contour Plot,

you can specify the scale

Jim
jerry_cooper
Staff (Retired)

Re: Graph Builder heat map: how to share the same scale for all years?

Hi C.B.,

My response does not necessarily answer your specific request, but it might get you closer to what I believe to be your intent. The following approach will give a visual reference for the total population size for the year, by color, while maintaining the same number of contours for each year.

First, create a new formula column in your table to aggregate the total number of observations by year. This can be done with the Col Number( :Any_Numeric_Column, <by Variable> ) formula. Note that :Any_Numeric_Column could be pre-existing in your table, or you could create a new numeric column and populate it to ensure non-missing data for each row if that is desired - the formula aggregates only the non-missing rows for the column specified. The <by Variable> in your case would be the year column.

Then create the graph as you did in your original post and drop the new formula column into the Overlay landing zone. This will create a legend showing the totals by year with a unique color for each year.  I've used the San Francisco Crime data table from the Sample Data directory as an example output:

10764_SF_Crime_by_day.jpg

Hope this helps.

jerry_cooper
Staff (Retired)

Re: Graph Builder heat map: how to share the same scale for all years?

The column formula in my previous post should read: Col Number( :Any_numeric_column, byVariable ) where the byVariable in your case would be the year column.

claude_bellavan
Level III

Re: Graph Builder heat map: how to share the same scale for all years?

Thank you! Very interesting. I'll try this soon.

CB