pie graphs+heat mapsHello everyone,
As a marine biologist, I recently stumbled across a visual presentation of coral reef data that I really like (see attachment). In it, you will see various pie graphs in which the individual wedges are essentially heat maps to show relative levels of certain parameters. I would like to adapt this for my own research, and I THINK it cn be done with Graph Builder, though not as a heat map, per se. Here is my idea: say I want four pie wedges representing four response variables (A, B, C, and D). The size is unimportant, so I will give each a value of 0.25 so that they occupy equal areas. I realize I can overlay color, so I created a "color" column and assigned values for the four response variables, but then my graph didn't change accordingly.
I tried value coloring and labeling, but no luck. I feel like I just set up my table wrong! Any suggestions?? Thanks!
Re: pie graphs+heat mapsAnderson,
That human body example is used here :Analysis of Personal Diet and Fitness Data with JMP and here: Using Custom Maps as Selection Filters to Subset and Explore Graphs of My Workout Data in JMP® 12
I saw your Discovery Summit Americas 2020 Presentation recording :Towards Predicting the Fate of Reef Corals (2020-US-45MP-615) but I'm looking to forward to seeing it live!
~John
Re: pie graphs+heat mapsJohn,
This is great, and I fully intend to watch the talk your week (it is on my schedule.). I think this capacity, along with the "graphlets," will open up all kinds of doors for overlaying data onto Graphbuilder graphs and plotting data onto custom figures (like the human body example we talked about earlier that is found somewhere on the JMP website in the form of a tutorial, I believe). I'll be curious to see if anyone has any suggestions in terms of aesthetics. I personally like the pie graphs, but maybe there is a better way we are not even considering? I like your idea of the video game style "health bars," too.
Come to think of it, maybe this could benefit epidemiologists. For instance, if you had infection rates overlaid on a lat-lon grid, then pinned wedges/pie graphs with additional information about patients or groups of patients on the contour plot, you could potentially add a layer of complexity that may not be possible using the standard GraphBuilder features (I guess for most types of data, the graphlets would work for this, too, though).
Re: pie graphs+heat mapsThis discussion inspired me to create a paper and presentation for JMP Discovery Americas 2020. What do you get when you combine a Marine Biologist, a Video Game, and JMP? (2020-US-45MP-543)
As I prepared the paper, I had time to experiment and improve on the techniques described in this post.
Included with the paper, are some resources (custom maps and examples) and detailed instructions on how to use them.
I hope you will find this post and my paper useful.
Thanks,
~John
Re: pie graphs+heat mapsAnderson,
Graph Builder doesn't provide a way to place bar charts or pie charts at specific locations on a map. You can get around it by:
- Creating a table from your Graph Builder graph where you use sample number in the map role (built using bars or the custom map shapes. This creates a table with sample number column and a column of images for each sample.
- Copy the image column from the generated table back to the unstacked data table( make sure that the image column matches the order of the sample number. **
- a. Label the image column OR b. Set 'Use as Marker' for the image column.
- Using the unstacked data table, create a Contour Map in Graph Builder using salinity or temp column as the color Role.
- Add a points element. Optionally using another color role.
- If you follow step 3.a, the images will appear in hover labels. You can pin some hover labels and Replace Text to remove any unwanted hover label text.
- if you follow step 3 b, all markers will be shown with the image from the image column. This can cause a cluttered display which you can resolve by zooming in or by deleting images that are overlapping.
** I found they were not in the same order, and had to sort before copying the image column. In hindsight, I realized I could have used a join or virtual join to get the images on the correct rows. I wish I would have read this first: https://community.jmp.com/t5/JSL-Cookbook/Geographic-Maps-with-Graphs-as-Markers/ta-p/53782.
I published both 3.a and 3.b here:
https://public.jmp.com/packages/Heat-contour-with-image-annotations/js-p/5d64597acf28b80f980812ba

About the method I used to draw the bars. I didn't use custom maps, I used the custom graphics script to calculate the length of the bars and to position them above each point.
When it comes to streamlining, JSL is often the best choice.
~John
Re: pie graphs+heat mapsJohn,
This is great! Do you think it could be done directly in Graph Builder or would it require scripting and advanced knowledge to do so? I know I can just modify the script but I’m just thinking in terms of streamlining it were I to go with this option over the pie graphs for tons and tons of data. Did it require a custom shape or did you manually pin all those icons in the map?
Re: pie graphs+heat mapsYour welcome Anderson and DS,
I published a better custom graphics script example annotating three variables per point on a map.

It's on JMP Public. Just click on the following following link:
https://public.jmp.com/packages/5d605bce3560ce0d2cafd48b
I used simple bars(thick lines) to represent three contrived cell values per point. Pie shapes would take a bit more work, but I wanted to offer this up as a proof of concept. The JSL script can be seen and downloaded from the post details on JMP Public.
~John
Re: pie graphs+heat mapsWow! This is great. Thanks for all the help and info John. I had no idea that the custom map feature existed, so I went down that "rabbit hole" for a day or two just thinking about all the cool ways I could use that to plot data onto traced images of the corals I study (sadly, though, I rarely take tons of samples WITHIN the same colony, though it's definitely a backburner project idea, and this would be a cool way to display the findings).
I think having the ability to plot data onto whichever kind of shape, image, etc. is definitely a JMP feature that more people should know about, and I suggest having it be an actual feature within the package in the future (rather than as an add-in, though the add-in works fine for the time being).
To DS: I had actually just thought about making my pie graphs and maps in JMP (plotting data on maps is pretty straight-forward with JMP once you've done it a time or two), then using Adobe to make the types of figures shown in my original post, but JMP has ways to annotate data points on plots, evening pinning images to them. Therefore, with a bit of practice and work, you very well could likely make virtually the ENTIRE map+data figure in my original post in JMP alone. In fact, I may try to do just this in the coming weeks.
Thanks again to John for providing the solution!
Re: pie graphs+heat mapsHi @John_Powell_JMP,
Thanks for the additional information. I've bookmarked this discussion so I can have it on file and then also go back to re-read the additional info you sent.
Sorry, I worry I might have not explained what I meant about marking your post as a solution -- I don't think I can because I wasn't the original poster (and therefore don't have that option), not because you didn't address the heatmap. My apologies if it read that way -- I went back and re-read it, and it does kind of sound like I was saying it that way (not good on my part).
I'm familiar with JSL and use it for many other things, but have not attempted using it for customized graphing like this, so this will be a new area for me to learn!
Thanks!,
DSRe: pie graphs+heat mapsThanks for your kind words @SDF1 .
You're right that I didn't completely answer the part about overlaying theses graphics over a background map.
Overlaying on a map would require a different mechanism, like using the script in the Customize dialog:
There are some sample scripts provided:

You can find information on the Customize feature here:
https://www.jmp.com/support/help/14-2/customize-graphical-elements.shtml
Here's a small example using circles:

Re: pie graphs+heat mapsHi @John_Powell_JMP,
Thanks for your quick and clear reply. Before I had received your response, I re-read the original post and realized I skimmed it too quickly and noted the mention of the last five columns.
I then downloaded your content from JMP Public and looked more into the details there and noticed the reference to the map shape for the label column properties. I hadn't explored that possibility in the past, so have been reading a bit and experimenting with your maps. Very cool!
I was hoping to maybe also overlay in the background the longitude/latitude position of where the data was collected on the world map -- like in the example from the original poster. I think that's beyond what can be done in graph builder, though; however it would be cool. It is a nice visualization idea. Yes, I can definitely see how that be useful for my work. I tested it out on some of our data, and all I have to do is adjust the Name for the shape ID, and it works. Very nice, thank you!
By the way, I would mark your post as a solution (at least for the pie graph), but I don't think I can do that. Can JMP do both the pie graph and contour (or heatmap) as the original poster was hoping for?
Thanks!,
DSRe: pie graphs+heat mapsI stacked columns named: Sym GE HMS, host GE HMS, colony color, variability, and summed aberrancy index . In the table attached to the JMP Public post, they are now under the column named Responses with the label for each response(the old column names) in the Label column.
JMP doesn't automatically create sectional "bullseye" charts. There are a few steps involved:
- I created the custom map shape files provided with the JMP Public posting that define the sections and bullseye.
- In Graph Builder, I dragged the Label column to the Shape role (bottom left), which displayed the outline of the custom shape.
- To get the colors applied, I dragged the Responses column to the Color role(on the right). This fills in the shape with the average responses for each sector.
- To separate out each sample, I dragged the sample number column into the Wrap role(top right).
I can't take credit for the nice visualization idea. It came from the original poster.
I'm glad to see it may help you out too.
~John
Re: pie graphs+heat mapsHi @John_Powell_JMP,
I'm really interested in trying my hand at this to see if I could adapt it to some of the reporting my business does.
You mention that you stacked by the columns of interest, but which ones are those? I downloaded the data table, but can't figure out which columns are needed to stack. And, does JMP automatically generate the pie chart as a sectional "bullseye", or is this a separate setting. I haven't seen one like this before. It's a nice visualization, and new to me, which is why I'm curious about it.
Thanks!,
DSRe: pie graphs+heat mapsWith the columns of interest stacked, a custom map can be used to acheive the visualization you're looking for.
Here's an example on JMP public using the data you've supplied.
You can find the custom map and modified data table at:
https://public.jmp.com/packages/5d5aa110f40f010268e63cf4
~John
Re: pie graphs+heat mapsI am still stumped, so I thought I'd attach the actual data file. Basically, I want to put the last five columns into a pie graph in which the wedge colors reflect the colors in the cells (wrapped by sample number). I am beginning to think this may not be possible with Graph Builder.....
Re: pie graphs+heat mapsHello ,
I'm joining this discussion quite late, but I am trying to create a very similar type of visualization. I'm particularly interested in the "3.b" solution, as I want to display pie charts on a grid across Europe (the label style is not readable at all in this scenario).
Point is that when I use graphs as marker, the background is white which doesn't look so good on the maps : they tend to overlap on the corner.
Although I can make the white area smaller by adjusting the pie chart size, the white background remains visible. Is there a way to make this background transparent or remove it entirely in JMP 17 ?
Johanna
Re: pie graphs+heat mapsHi @johanna_younous ,
Welcome to the conversation.
When I first joined this conversation, I had white backgrounds in my graphs too.
By the time I did the presentation I mentioned above, I figured out how to make the background transparent.
I used the following JSL script to make the white pixels transparent in my table of images where the name of the column of graph images was "Graph".
dt=CurrentDataTable();
For Each Row(
{r, g, b} = dt:Graph[] << getpixels( "rgb" );
a = !AND(r == g, g == b);
dt:Graph[] << setpixels( "rgba", {r, g, b, a} );
);
This also makes gray pixels transparent where the red, green, and blue color components are all the same. I had some gray in the background too.
I hope this works for you.
~John
Re: pie graphs+heat mapsThank you @John_Powell_JMP ,
Unfortunately, this loop is not fully working for me, and I 'm struggling to figure out why.
When I run the full loop, the white background on my graphs is not removed:
);
dtgraph= Graphbuild<< Make Into Data Table( );
For( i=1, i <= nrows(dtgraph) , i++, //i=3
img =dtgraph:Graph[i] ;
{r, g, b} = img << getpixels( "rgb" );
// Pixel coloré → alpha = 1 (opaque)
// Pixel gris/blanc/noir (r==g==b) → alpha = 0 (transparent)
a = ! (r==g==b);
Wait(0);
img << setpixels("rgba", {r, g, b, a});
Wait(0);
dtgraph:Graph[i] = img;
);
But if I run this step by step, the update is successfully applied to the first row!
img =dtgraph:Graph[1] ;
{r, g, b} = img << getpixels( "rgb" );
// Pixel coloré → alpha = 1 (opaque)
// Pixel gris/blanc/noir (r==g==b) → alpha = 0 (transparent)
a = ! (r==g==b);
Wait(0);
img << setpixels("rgba", {r, g, b, a});
Wait(0);
dtgraph:Graph[1] = img;
This is driving me crazy so far. I'm guessing it might be a question of update timing or something linked to the Expression type column?
Any insights would be greatly appreciated
Johanna
Re: pie graphs+heat mapsWhile this solution (and many of the other contributions) are quite innovative, I have to say that I don't find the pie charts very useful at all (it reminds me of the Tufte quote, which I'll paraphrase since I can't remember exactly where he said it: "the only thing worse than one stupid pie chart is more than one stupid pie chart). Doughnuts, as usual, are better than pie charts, but I think bar graphs work much better in this case. With the multiple comparisons across the 4 dimensions you have a couple of issues: first is the ordering of the pieces and the second is the size of the pieces. It is easier to order bars than slices of pie and the sizes are also much better compared with bars. There may well be other displays that work even better, but I really don't see these pie charts as easy to decipher at all.
Re: pie graphs+heat mapsMeanwhile, I managed to get it work in the most surprising way ( after I went through a long journey of tests and fails as can testify this really suboptimal script)
dtgraph= Graphbuild<< Make Into Data Table( );
For( i=1, i <= nrows(dtgraph) , i++, //i=6;
img =dtgraph:Graph[i] ; //
img1=char(img);
{r, g, b,a1} = img << Get Pixels( "rgba" );
a2 = !AND(r == g, g == b);
Wait(0);
eval(parse( "img << set Pixels(\!"rgba\!", {r, g, b, a2})" ));
img2= char(img);
print(img1==img2);
Wait(0);
dtgraph:Graph[i] = parse(char(img2));
img=empty();
);
print("fin loop1");
//exact same loop !!
For( i=1, i <= nrows(dtgraph) , i++, //i=6;
img =dtgraph:Graph[i] ; //
img1=char(img);
{r, g, b,a1} = img << Get Pixels( "rgba" );
a2 = !AND(r == g, g == b);
Wait(0);
eval(parse( "img << set Pixels(\!"rgba\!", {r, g, b, a2})" ));
img2= char(img);
print(img1==img2);
Wait(0);
dtgraph:Graph[i] = parse(char(img2));
img=empty();
);
print("fin loop2");
// log output
1
1
1
1
1
1
"fin loop1"
0
0
0
0
0
0
"fin loop2"
It's a really, really weird behavior, but since it works, let's say that's good enough: I spent way too much time on this problem ^^
I would still be really interested in any explanation on this phenomenon.
Re: pie graphs+heat mapsI agree with you on that point, nevertheless, that a request from my stakeholders .... pie charts ( and even worst, radar charts) it is !
Re: pie graphs+heat maps@johanna_younous ,
While I'm glad you were able to find a solution and share it with the community, I agree that there is probably a simpler, more efficient solution. It could be that "For Each" loops have advantages over "For" loops.
I was surprised to see that you used "rgba" in the Get Pixels function, but maybe after running the script once, the pixels in the images had an alpha component.
Where I used my script, the images were in a separate data table and linked using virtual join. That may be different from your situation, causing the change in images to be reflected immediately for me.
Maybe someone in the community with more JMP scripting expertise than I will be able to provide a simpler solution or explanation.
Thanks,
~John