Plotting a logarithmic colorbar for a variable plotted using lat/long
Show older comments
Hi
I have been trying to plot my data points using their lat/long coordinates. The positioning is correct, and they seem to be plotting so that the values are scaled correctly.
The only problem is that I cannot figure out how to plot the colorbar logarithmically. Most of the point lie between 0 and 1, but a few are higher which is why I would like to have is begin at 0, and go up to 10, so the differences in the values can be displayed better.
Me and a a friend have been trying to crack this one since yesterday to no avail. Does anyone know what I am doing wrong? How can I fix this?
(On a smaller not, how do I chance the colour scheme. I like jet, due to the convenience for displaying a range of values).
I have included my current code, and the dataset that I am using. (Three columns, Lat, long, and f0 value at the site - This third variable is the one I am trying to plot a logarithmic colour bar for).
Thank you, Joey
Code:
%My current attempts at trying to plot the f0 and assign a logarithmic
%scale bar to the f0 values
clear %Clears workspace
clf % Clears figures
clc % Clears command window
close % Clears curret figures
load Plotting_f0.txt;
f0 = Plotting_f0;
latf0 = f0(:,1);
longf0 = f0(:,2);
f0vals = f0(:,3);
f0_10=10.^f0vals;
f0_log=log(f0vals);
figure (1)
worldmap ([53.53 53.6], [-3.11 -2.9]);
c=[0.1 1/3 10 10/3 10];
markerSize = 100;
scatterm(latf0, longf0, markerSize, f0_log,'.');
col=colorbar('Ticks',(round(min(f0_log)-1) : 1 : round(max(f0_log)+1)));
title(col,'Log f0');
title('f0 values across the mapping area')
Answers (1)
Categories
Find more on Lengths and Angles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!