Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I build a gradient colored table based on its values in matlab?

I have a 24x2 matrix in matlab. I need to represent this data in a table but also make sure that each of the rows are colored on various hues of a colors (like a heat map) based on the values of the second column.

Is there a matlab function that can render such table figures? Or is there any other language or tool that can support such a facility?

like image 303
Dexters Avatar asked May 22 '12 04:05

Dexters


People also ask

How do you plot a gradient in Matlab?

Plot Gradient of FunctionFind the gradient of a function f(x,y) , and plot it as a quiver (velocity) plot. Find the gradient vector of f(x,y) with respect to vector [x,y] . The gradient is vector g with these components. Now plot the vector field defined by these components.

How do you use the gradient function in Matlab?

[ FX , FY ] = gradient( F ) returns the x and y components of the two-dimensional numerical gradient of matrix F . The additional output FY corresponds to ∂F/∂y, which are the differences in the y (vertical) direction. The spacing between points in each direction is assumed to be 1 .

How do you make a color scale in Matlab?

Create a surface plot of the peaks function and specify a colormap. Return the three-column matrix of values that define the colors used in the plot. Each row is an RGB triplet color value that specifies one color of the colormap.

How do you fill a plot with color in Matlab?

Specify an m-by-n matrix of colormap indices, where [m,n] = size(X) . Specify one color per vertex. Create matrices x , y , and c . Then plot the filled region with fill color interpolated from vertex colors c .


2 Answers

You can use uitable to display a matrix as a table. It has a BackgroundColor property, but that can only be set for the entire table.

You can however get around this by inserting custom HTML tables like described here.

like image 65
Junuxx Avatar answered Oct 05 '22 08:10

Junuxx


Here's the uitable properties list:

http://www.mathworks.com/help/techdoc/ref/uitableproperties.html

Using handles, you can create one figure and make individual tables, each one column, each with their own BackgroundColor and Position properties.

Here's an example of multiple uitables on one figure:

Display multiple uitable objects in the same figure?

like image 28
Keegan Keplinger Avatar answered Oct 05 '22 06:10

Keegan Keplinger