Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Level III

multiple y-axes for non-redundant data

Dear JMP community

I am preparing side by side heat maps of gene expression changes with two y-axes in each (Gene Ontology and Function). 

For now I am making separate graphs and cobbling them together in powerpoint. See picture:

heat map.PNG



It would be great to make them in one graph window in order to standardize the legend, and all other attributes

However this is not working out for me (see picture). In essence I want to make multiple Y-axes for non-redundant data. 

Cell plot with two labels and the "by" function works OK but the legend is not easily modifiable so I am not using that option


heat map combined.PNG 



Super User

Re: multiple y-axes for non-redundant data

Does an output like this help you at all?


Attached is the sample data table I used for the generation of this chart, below is the script

names default to here(1);
dt=current data table();

// Add Blank Columns
dt << Add Multiple Columns( "color", 3, after(:gene ontology),Character);

// Change data table original names
dt:Biological << set name("Biological Value");
dt:Color 1 << set name("Biological");
dt:Cellular << set name("Cellular Value");
dt:Color 2 << set name("Cellular");
dt:Molecular << set name("Molecular Value");
dt:Color 3 << set name("Molecular");

// Stack the values
dtStack = dt << Stack(
	columns( :Biological Value, :Cellular Value, :Molecular Value ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" ),
	Name( "Non-stacked columns" )(Keep( :Gene Ontology ))

// Delete missing value cells
dtStack << select where(ismissing(:data));
dtStack << delete rows;

dtStack:Data << set name("% of transcript");

// set the colors
dtStack << Color by Column( :Name("% of transcript"), Make window with legend(1));
current data table(dtStack);
For(i=1,i<=N Rows(dtStack),i++,
	theRow = dt << get rows where(dtStack:Gene Ontology[i] == :gene ontology);
	If(dtStack:Label[i] == "Molecular Value",
		dt:Molecular << color cells(color of(rowstate(i)),theRow[1]),
	dtStack:Label[i] == "Biological Value",
		dt:Biological << color cells(color of(rowstate(i)),theRow[1]),
	dtStack:Label[i] == "Cellular Value",
		dt:Cellular << color cells(color of(rowstate(i)),theRow[1]),
close( dtStack, nosave );

// Get rid on unwanted columns
dt << delete columns({"Biological Value","Cellular Value","Molecular Value"});

// Perform some crazy manuvers to get the data table and graph as a static
// image in the final display
nw2=new window("temp",<<journal);
dt << journal;
nw3 = new window("temp2", hlb=H List Box());
hlb << append(nw2);
hlb << append(window("Legend"));
nw2 << close window;

nw = new window("Output", << journal,
	ob = Outline Box("Function & Gene Ontology")

ob << append(nw3<<get picture);
nw3 << close window;
window("legend") << close window;  // not working...not sure why


Level III

Re: multiple y-axes for non-redundant data

Thank you Jim for your time but this is different than what I want. I will stay with the manual process and maybe the feature will be available in future versions.
Best of health,
Super User

Re: multiple y-axes for non-redundant data

Shucks.........I thought I might have found something that would help you out.
Article Labels