matlab-figure

use marker fill colors according to data value in MATLAB

六月ゝ 毕业季﹏ 提交于 2020-02-20 10:30:13
问题 I am using matlab to plot three data series. e.g. 0.4545 0.7676 10 0.3232 0.5432 20 Lets say this is a 100 x 3 matrix. (Lets call it A, also it is sorted according to A(:,1) )The third column is an additional number which ranges from 1 to 100. I am using MATLAB to do the following: plot (A(:,1)); hold on; plot (A(:,2)); I am using the property editor to represent data-series A(:,1) in line format and A(:,2) with additional marker [square i.e --rs option in plot]. My question is, how do I fill

use marker fill colors according to data value in MATLAB

青春壹個敷衍的年華 提交于 2020-02-20 10:29:29
问题 I am using matlab to plot three data series. e.g. 0.4545 0.7676 10 0.3232 0.5432 20 Lets say this is a 100 x 3 matrix. (Lets call it A, also it is sorted according to A(:,1) )The third column is an additional number which ranges from 1 to 100. I am using MATLAB to do the following: plot (A(:,1)); hold on; plot (A(:,2)); I am using the property editor to represent data-series A(:,1) in line format and A(:,2) with additional marker [square i.e --rs option in plot]. My question is, how do I fill

Commands for a Specific Colorbar [closed]

谁说我不能喝 提交于 2020-01-26 04:52:14
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 days ago . I am trying to write a script for this colorbar: Where could I find such a script? 回答1: Colorbars exist in Matlab (in fact, the command is colorbar). You can even change the color setting, e.g. by colormap winter (which will change both, the figure itself and the corresponding bar

Adding description outside the plot with coloured text

泄露秘密 提交于 2020-01-24 19:30:09
问题 I am working on a visualisation of my data and would like to add a description of a plot. The description will be added outside the plot. For that I have written: plot(1:10) text(2,8,'my text here ','Color','green','FontSize',14,'location','EastOutside') But it doesn't work, I get the error: There is no location property on the Text class. How can I fix this? This is my desired output: 回答1: The location input pair you're giving to text are for the legend , not text objects... The location is

Matlab: Subplot for 2 rows and 10 columns

那年仲夏 提交于 2020-01-24 18:11:31
问题 How can I plot 20 images in one plot with 2 rows and 10 columns in matlab? I know I have to use subplot() function. But I am confused regarding the parameters to be given. I tried giving subplot(2,10,row_index,col_index) but it doesn't seem to work.Please help. 回答1: The first two arguments of the subplot function give the total number of rows and columns of subplots in the figure, respectively, and the third gives the row-wise linear index of the current subplot. If you want a 2x10 matrix of

How to include Annotate extends … in this MATLAB findpeaks?

随声附和 提交于 2020-01-23 18:38:10
问题 I have minimums and maximums in the output now (Fig.1) but I would like to get labels (Fig. 2) for sorted maximums (tallest get 1, ...) and similarly for minimums (lowest gets 1). I can do the output of Fig. 1 by the following but I cannot integrate those annotations to the function close all; clear all; clc; % https://se.mathworks.com/help/signal/ref/findpeaks.html % http://stackoverflow.com/a/26837689/54964 x = linspace(0,1,1000); Pos = [1 2 3 5 7 8]/10; Hgt = [4 4 2 2 2 3]; Wdt = [3 8 4 3

How to save custom-sized figures [duplicate]

北城以北 提交于 2020-01-23 13:02:41
问题 This question already has answers here : Closed 8 years ago . Possible Duplicates: Printing a MATLAB plot in exact dimensions on paper How do I save a plotted image and maintain the original image size in MATLAB? I have recently been trying to create a custom-sized graph in MATLAB and save it automatically using the saveas function. In particular, I am having issues saving the files in the size that I create them. Roughly speaking, my code is as follows: mygraph = figure('Position',[1,20,1280

How to flip the x-axis?

匆匆过客 提交于 2020-01-21 18:54:07
问题 I am plotting amplitude reconstruction of FMCW radar. I want to flip the inside graph only. However the x axes shoud be the same. How shoud i do it. Below is my code for plotting. for i = 1:2500 %%%% dividing each row by first row. resd(i,:) = res3(i,:)./res3(1,:); end f = fs/2*linspace(0,1,nfft/2+1); %%%% defining frequency axes K = BW/Tm; t = f/K; deltaf = 1/max(t); fmax = 1 / t(2)-t(1); f1 = 0:deltaf:fmax; % f1 = fmax:deltaf:0; f2 = f1 + fc; %%%%%% Amplitude reconstruction figure(1),plot

Plotting a cell array

为君一笑 提交于 2020-01-16 03:59:06
问题 I need to plot a cell array with the following format in Matlab: {[vector1], [vector2], ...} Into a 2D graph with the index of the vector as the y and the vector as the x ([vector1], 1), ([vector2], 2), ... 回答1: Here's a simple option: % some arbitrary data: CellData = {rand(10,1)*50,rand(10,1)*50,rand(10,1)*50}; % Define x and y: x = cell2mat(CellData); y = ones(size(x,1),1)*(1:size(x,2)); % plot: plot(x,y,'o') ylim([0 size(x,2)+1]) so you plot each vector of x on a separate y value: It will

MATLAB only prints a part of my figure

断了今生、忘了曾经 提交于 2020-01-16 02:03:41
问题 I'm trying to print my figure in MATLAB, but it keeps screwing up and I have no idea why. opslaan = figure(1); plot(1:handles.aantal,handles.nauw,'-r','LineWidth',1.5); xlabel(gca,sprintf('Framenummer (%g ms per frame)',60/handles.aantal)); ylabel(gca,'dB'); set(gca,'YGrid','on'); yAsMax = ceil( ceil(max(handles.nauw)) / 2) * 2; axis([0 handles.aantal 0 yAsMax]); pause(1); print -dpng image.png The first line is just plotting the data on my figure, then labeling x and y, turning on grid and