Heat map + Numbers: Difference between revisions

From Wiki
Jump to navigation Jump to search
New page: c1 = {{"\!\(\*SubscriptBox[\(E\), \(sol\)]\)", "Ir", "Ru", "Sn", "Ti"}, {"\!\(\*SubscriptBox[\(IrO\), \(2\)]\)", 0.00, -0.14, 0.80, 0.37}, {"\!\(\*SubscriptBox[\(RuO\), \(2\)]\)", ...
 
No edit summary
Line 1: Line 1:
c1 = {{"\!\(\*SubscriptBox[\(E\), \(sol\)]\)", "Ir", "Ru", "Sn",  
First we write down the First Matrix, in which every number will be represented by a color
  "Ti"}, {"\!\(\*SubscriptBox[\(IrO\), \(2\)]\)", 0.00, -0.14, 0.80,
N.B. The table contains also the Axis Legend.
  0.37}, {"\!\(\*SubscriptBox[\(RuO\), \(2\)]\)", -0.10, 0.00, 1.03,
  0.69}, {"\!\(\*SubscriptBox[\(SnO\), \(2\)]\)", 0.54, 0.43, 0.00,
  0.17}, {"\!\(\*SubscriptBox[\(TiO\), \(2\)]\)", -0.71, 0.63, 0.62,
  0.00}}(*Coloured Grid*)


c2 = {{"0.00", -0.14, "0.80", 0.37}, {"-0.10", "0.00", 1.03,  
  c1 = {
  0.69}, {0.54, 0.43, "0.00", 0.17}, {-0.71, 0.63, 0.62,  
        {"\!\(\*SubscriptBox[\(E\), \(sol\)]\)", "Ir", "Ru", "Sn", "Ti"},
  "0.00"}}(*Numbered Grid*)
        {"\!\(\*SubscriptBox[\(IrO\), \(2\)]\)", 0.00, -0.14, 0.80, 0.37},  
        {"\!\(\*SubscriptBox[\(RuO\), \(2\)]\)", -0.10, 0.00, 1.03, 0.69},  
        {"\!\(\*SubscriptBox[\(SnO\), \(2\)]\)", 0.54, 0.43, 0.00, 0.17},  
        {"\!\(\*SubscriptBox[\(TiO\), \(2\)]\)", -0.71, 0.63, 0.62, 0.00}
        }


n1 = c1[[2 ;; All, 2 ;; All]] (*Numerical Part of the Coloured Grid*)
Second, we write down a Second Matrix, in which the numbers will be written over the colored tables
 
  c2 = {
        {"0.00", -0.14, "0.80", 0.37},
        {"-0.10", "0.00", 1.03, 0.69},
        {0.54, 0.43, "0.00", 0.17},
        {-0.71, 0.63, 0.62, "0.00"}
        }
 
Then we isolate the numerical part of the first matrix
 
  n1 = c1[[2 ;; All, 2 ;; All]]  
 
We


l1 = c1[[2 ;; All, 1]] (*Width of a line*)
l1 = c1[[2 ;; All, 1]] (*Width of a line*)

Revision as of 15:21, 6 July 2012

First we write down the First Matrix, in which every number will be represented by a color N.B. The table contains also the Axis Legend.

  c1 = {
       {"\!\(\*SubscriptBox[\(E\), \(sol\)]\)", "Ir", "Ru", "Sn", "Ti"}, 
       {"\!\(\*SubscriptBox[\(IrO\), \(2\)]\)", 0.00, -0.14, 0.80, 0.37}, 
       {"\!\(\*SubscriptBox[\(RuO\), \(2\)]\)", -0.10, 0.00, 1.03, 0.69}, 
       {"\!\(\*SubscriptBox[\(SnO\), \(2\)]\)", 0.54, 0.43, 0.00, 0.17}, 
       {"\!\(\*SubscriptBox[\(TiO\), \(2\)]\)", -0.71, 0.63, 0.62, 0.00}
       }

Second, we write down a Second Matrix, in which the numbers will be written over the colored tables

  c2 = {
       {"0.00", -0.14, "0.80", 0.37}, 
       {"-0.10", "0.00", 1.03, 0.69}, 
       {0.54, 0.43, "0.00", 0.17}, 
       {-0.71, 0.63, 0.62, "0.00"}
       }

Then we isolate the numerical part of the first matrix

  n1 = c12 ;; All, 2 ;; All 

We

l1 = c12 ;; All, 1 (*Width of a line*)

p1 = c11, 2 ;; All (*Height of a column*)

ImageCompose[

ArrayPlot[n1, ColorFunction -> "Rainbow", 
 ColorFunctionScaling -> True, Frame -> True, 
 FrameStyle -> Opacity[0], AspectRatio -> 0.737, 
 FrameTicks -> {{Transpose[{Range[Length[l1]], l1}], None}, {None, 
    Transpose[{Range[Length[p1]], p1}]}},
 FrameTicksStyle -> 
  Directive[Opacity[1], Bold, FontSize -> 60, FontFamily -> "Times"],
  Mesh -> All, MeshStyle -> White, ImageSize -> 1000],
GraphicsGrid[c2, BaseStyle -> {"Times", 45, Bold, White}, 
 AspectRatio -> 0.75, ImageSize -> 780] , {580, 310}]