sphear_plot_r.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. %% -*- mode: octave -*-
  2. %%
  3. %% *SpHEAR Project
  4. %%
  5. %% sphear_plot_r: plot A format measurement power in a range of frequencies
  6. %%
  7. %% usage:
  8. %% [] = sphear_plot_r(R, shift)
  9. %%
  10. %% R: array of measurements for all four capsules
  11. %% shift: overall angle offset adjustment for plotting
  12. %%
  13. %% Copyright 2016-2017, Fernando Lopez-Lezcano, All Rights Reserved
  14. %% nando@ccrma.stanford.edu
  15. %%
  16. %% This program is free software: you can redistribute it and/or modify
  17. %% it under the terms of the GNU General Public License as published by
  18. %% the Free Software Foundation, either version 3 of the License, or
  19. %% (at your option) any later version.
  20. %%
  21. %% This program is distributed in the hope that it will be useful,
  22. %% but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. %% GNU General Public License for more details.
  25. %%
  26. %% You should have received a copy of the GNU General Public License
  27. %% along with this program. If not, see <http://www.gnu.org/licenses/>.
  28. function [] = sphear_plot_r(R, shift);
  29. figure();
  30. hold on;
  31. grid on;
  32. RS = circshift(R, shift);
  33. %% number of measurements
  34. m = size(RS)(1);
  35. x = (0:size(RS)(1)-1) / size(RS)(1) * 360;
  36. xlim([0, 360]);
  37. tics('x', [0, 45, 90, 135, 180, 225, 270, 315, 360]);
  38. ca = get (gcf, "currentaxes");
  39. set(ca,"fontweight","bold","linewidth",1.5);
  40. color = ['r', 'b', 'g', 'm', 'r', 'b', 'g', 'm'];
  41. style = ['-', '-', '-', '-', '-', '-', '-', '-'];
  42. marker = ['s', 's', 's', 's', 'o', 'o', 'o', 'o'];
  43. for c = (1:size(R,2))
  44. p(c) = plot(x, RS(:,c), 'color', color(c), 'marker', marker(c), 'linewidth', 1.5, 'linestyle', style(c));
  45. end
  46. l = legend(p, {"capsule 1", "capsule 2", "capsule 3", "capsule 4",
  47. "capsule 5", "capsule 6", "capsule 7", "capsule 8"});
  48. legend(l, 'location', 'bestoutside');
  49. hold off;
  50. end