2014-01-21 174 views
0

我有下面的图像,我想深度轴的范围如下: (10 9.5 9 8.5 8 7.5 7 6 5 3 2 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0)来显示深度1和0之间的数据在规模较大,并且我有以下代码matlab中一个轴的缩放部分

depths = [10 5 1 0.5 0; 10 5 1 0.5 0] % these are the real depths in meter 
contourf(points,depths,RFU15102013_BloomAsMainPoint); 
set(gca, 'XTick', points(1) : points(2), 'XTickLabel',{ 'LSB1', 'LSB2'}); 
ylabel('Depth(m)'); 
xlabel('Points'); 
title('Date: 15.10.2013'); 

这是图像: enter image description here

如何做呢?

EDIT1

真实数据:

RFU15102013_BloomAsMainPoint = [ 2.71 1.23 1.30 1.20 14.37 ; 2.51 1.36 1.01 1.24 1.15];

points = [1 1 1 1 1; 2 2 2 2 2 ];

depths = [10 5 1 0.5 0; 10 5 1 0.5 0];

+0

@divanov,你的意思是'contourf'输入?? – Parid0kht

+0

@divanov,我刚刚添加了您要求的数据。 – Parid0kht

+0

我已经用您提供的数据更新了我的答案。 – divanov

回答

1

由于大部分数据在零附近变化,所以它可能足以改变Y轴的缩放比例。下面是一个例子

close all; clear all; 

z = [ 2.71 1.23 1.30 1.20 14.37 ; 2.51 1.36 1.01 1.24 1.15]; 
x = repmat([1; 2], 1, 5); 
y = repmat([10 5 1 0.5 0], 2, 1); 

% plotting with equally spaced y-s 
h = subplot(1,2,1); 
contourf(x,y,z); 

y2 = log(y + 0.25); 
yTicks = linspace(min(y2(1,:)), max(y2(1,:)), 10); 

% plotting with logarithmically spaced y-s 
h = subplot(1,2,2) 
contourf(x,y2,z); 
set(h,'YTick', yTicks) 
set(h,'YTickLabel', exp(yTicks) - 0.25); 

print('-dpng','scaling.png') 

结果 contour plot

这种方式可以应用于轴缩放任何单调连续函数。

+0

谢谢,我用它..但它不会显示我的数据...这个数字是白色的! – Parid0kht

+0

不..不说什么! – Parid0kht

+1

非常感谢您的关注:) – Parid0kht

0

你可以使用UIMAGE - UIMAGESC MathWorks的文件交换,并设置y值来强调1到0范围内的点。

+0

谢谢..但我认为'BreakPlot'功能更好..但它给了我错误。 – Parid0kht