Proper Labeling of X & Y values Contour Plot

21 views (last 30 days)
Is there a way to use arrays for labeling the X&Y values of a Contour Plot ..
In this case, Y would be Frequency and X Time ( radio telescope data acq sequence )
  1 Comment
DGM
DGM on 25 May 2022
How are you using contour? If you're calling contour() with three arguments, it should have ticks and tick labels on both axes already.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 25 May 2022
Use the tick label properties to change the tick labels. Any new tick values have to be in the ranges of the current tick values, so changing them is not likely to produce the desired results.
[X,Y,Z] = peaks(50);
figure
[c,h] = contourf(X, Y, Z);
Ax = gca; % Axes Handle
xt = Ax.XTick % Tick Values
xt = 1×7
-3 -2 -1 0 1 2 3
Ax.YTickLabel = xt*pi; % New Tick Labels
yt = Ax.YTick % Tick Values
yt = 1×7
-3 -2 -1 0 1 2 3
Ax.XTickLabel = yt-min(yt); % New Tick Labels
xlabel('Time (units)')
ylabel('Frequency (units)')
.
  3 Comments
Alex Pettit
Alex Pettit on 25 May 2022
GOT IT Nice : Thanks Everyone.
The data is in two column Freq / Ampl pairs from the SDR ( software defined radio ) at a data rate of
3000 FFT blocks per second. I am acquiring 5 minutes of data into one saved set .. consisting of 900,000 averages. Thankfully, I do not need to save the Time data !
FYI
Here is a surface plot of 100 data sets ( FFT 512 elements ) over ~ 8 hour period .
Freq range in the 1.42 GHz Hydrogen RF range .. Doppler shifted due th the relative motion of the Hydrogen clouds & Earth.
It represents a 10 degree wide, 8 hour long slice through the Milky Way and surrounding area
( A new hobby )
Regards,
Alex P
Star Strider
Star Strider on 25 May 2022
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!