Message Boards Message Boards

Change numbers in axes on ArrayPlot

Posted 10 years ago

Hello

I have a matrix of data that i want to plot using the next code

A = {{0.12, 1.5, 0.36}, {0.48, 0.17, 0.87}, {1, 0, 1}}; ArrayPlot[A, Mesh -> True, PlotTheme -> "Detailed", ColorFunction -> "Rainbow"]

but i would like to change the axis values , in the x axis i would like to have 1,5 and 10 instead of 1,2 and 3 and in the y axis 135,130,125 instead to 1,2,3

I hope someone could help me

Thanks

6 Replies

Please have a look at the option DataRange. Or alternatively have a look at the FrameTicks and Ticks options.

POSTED BY: Sander Huisman

oops

POSTED BY: Sander Huisman

I already try with that , the problem is just the labels, i dont want something numerated i want just a label or something like that

A = {{0.12, 1.5, 0.36}, {0.48, 0.17, 0.87}, {1, 0, 1}};
MatrixPlot[A, Mesh -> True, DataRange -> {{1, 10}, {125, 135}}, 
 FrameTicks -> {{125, 130, 135}, {1, 5, 10}}, AspectRatio -> 1, 
 PlotTheme -> "Detailed", ColorFunction -> "Rainbow"]

enter image description here

POSTED BY: Mariusz Iwaniuk

Please see this tutorial on the subject:

http://support.wolfram.com/kb/12480

POSTED BY: Sean Clarke

Thanks for the answers but that is not exactly what i would like to do, here is the actual data:

\[Omega]11 = 3.756;
\[Omega]12 = 8.478;
\[Omega]13 = 4.8002;
\[Omega]14 = 4.002;
\[Omega]15 = 4.803;
\[Omega]16 = 10;
\[Omega]17 = 10;
\[Omega]21 = 5.702;
\[Omega]22 = 5.311;
\[Omega]23 = 4.684;
\[Omega]24 = 5.237;
\[Omega]25 = 4.677;
\[Omega]26 = 10;
\[Omega]27 = 5.808;
\[Omega]31 = 4.856;
\[Omega]32 = 4.466;
\[Omega]33 = 4.408;
\[Omega]34 = 4.748;
\[Omega]35 = 5.615;
\[Omega]36 = 6.012;
\[Omega]37 = 6.347;
\[Omega]41 = 6.338;
\[Omega]42 = 6.092;
\[Omega]43 = 4.688;
\[Omega]44 = 5.163;
\[Omega]45 = 5.725;
\[Omega]46 = 6.21;
\[Omega]47 = 6.13;
\[Omega]51 = 6.14;
\[Omega]52 = 4.35;
\[Omega]53 = 4.954;
\[Omega]54 = 5.65;
\[Omega]55 = 5.74;
\[Omega]56 = 6.08;
\[Omega]57 = 6.19;
A = ( {
    {2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7},
    {\[Omega]11, \[Omega]12, \[Omega]13, \[Omega]14, \[Omega]15, \
\[Omega]16, \[Omega]17},
    {\[Omega]21, \[Omega]22, \[Omega]23, \[Omega]24, \[Omega]25, \
\[Omega]26, \[Omega]27},
    {\[Omega]31, \[Omega]32, \[Omega]33, \[Omega]34, \[Omega]35, \
\[Omega]36, \[Omega]37},
    {\[Omega]41, \[Omega]42, \[Omega]43, \[Omega]44, \[Omega]45, \
\[Omega]46, \[Omega]47},
    {\[Omega]51, \[Omega]52, \[Omega]53, \[Omega]54, \[Omega]55, \
\[Omega]56, \[Omega]57}
   } );
ArrayPlot[A, Mesh -> True, DataRange -> {{0, 25}, {90, 120}}, 
 FrameTicks -> {{90, 95, 100, 105, 110}, {1, 5, 10, 15, 20, 25}}, 
 AspectRatio -> 1, PlotTheme -> "Detailed", 
 ColorFunction -> "Rainbow"]

Now , i would like the first row to have a label in the x coordinate of 0.5, the second of 1, 3rd of 5, 4th of 10 5th of 15 till 7th of 25 and in the y axis bottom row of 90 next of 95 one befor the last one 110 and nothing in the last one

i hope that explain a little more my problem

Thanks and Regards

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract