簡體   English   中英

在Matlab中縮放軸的一部分

[英]scale part of an axis in matlab

我有以下圖像,希望深度軸范圍如下:(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之間的數據大規模地,我有以下代碼

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');

這是圖像: 在此處輸入圖片說明

我怎樣才能做到這一點?

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];

由於大多數數據都在零附近變化,因此足以更改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')

結果 等高線圖

這樣,可以應用用於軸縮放的任何單調連續函數。

您可以從mathworks文件交換中使用UIMAGE-UIMAGESC ,並將y值設置為emphaisize點,范圍為1到0。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM