Invalid parameter/value pair arguments using Mapping Toolbox

Hello
I´m having problems mapping global temperature using Mapping toolbox. This script is for displaying 3 different figures, annual, winter and summer. When it comes to setting the range and placement of colour bar as:
MinData = 100; % MaxData = 400; % set(gcf,'position',[0.6,0.1,0.4,0.4]); set(gca, 'CLim', MinData, MaxData);
I always get the following error message:
Error using set Invalid parameter/value pair arguments Error in ..... set(gca, 'CLim', MinData, MaxData);
But still the annual image pops out looking fine, without colour bar. Lets say I instead do:
set(gca, 'CLim', [MinData, MaxData]);
No error appears but then all figures turn red, with colour bars.
Any ideas?
Thanks, Hera

回答(1 个)

Have you called the colorbar command? Instead of using set(gca,..., I recommend giving the color bar a handle of its own, we'll call it cb:
cb = colorbar;
set(cb,'pos',[.6 .1 .4 .4])
caxis([MinData MaxData])
A few examples of tinkering with colorbars and mapped geospatial data can be found here and here.

类别

帮助中心File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

提问:

2014-10-9

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by