matlab-figure

How to enlarge legend symbols?

人盡茶涼 提交于 2019-12-11 13:09:40
问题 I am plotting my data as %% Plot relative wrt to GT for each frame XIndx_lsd = linspace(1,592, size( accu_RE_lsdSlam, 1 ) ); XIndx_my = linspace(1,592, size( accu_RE_my_method, 1 ) ); plot( XIndx_lsd, accu_RE_lsdSlam(:,5), 'r-.' ) hold on plot( XIndx_my, accu_RE_my_method(:,5), 'b-' ) AX=legend( 'rel translation error for Kerl et al.', 'rel translation error for D-EA' ); xhand = xlabel( 'Frame#' ); yhand = ylabel( '||trans(E_i)||_2 (in mm)' ); axis( [1 600 0 16] ); set(gca,'FontSize', 78);

Prevent Color Bar from Resizing Image in MATLAB

半腔热情 提交于 2019-12-11 12:58:07
问题 I am trying to add color bars to an image in MATLAB without losing the original resolution of the figure. This link explains how to deal with the fact that adding a color bar resizes the original image. But the solution makes the original loose information by enlarging using interpolation (the set method used in the 6th line from the bottom). It is crucial to my application that this does not happen (Trying to observe Moire effects on sub-sampling) The code I am using is appended below %%

Why do independent subplots overwrite each other? Why is the order of plotting important?

可紊 提交于 2019-12-11 12:54:09
问题 I'm writing a gui which requires to exactly position some subplots: h = figure('Units','pixels','Position',[1920 432 1881 982]*0.5); ax.VSize = 815.3800*0.5 ax.VOffset = 48.9228*0.5 ax.HSize = 1.8063e+03*0.5 ax.HOffset = 56.4480*0.5 subax.VSize = 0.33*(ax.VSize-3*ax.VOffset); subax.HSize = ax.HSize; subplot(313,'units','pixels','Position',[ax.HOffset ax.VOffset ax.HSize subax.VSize ]) subplot(312,'units','pixels','Position',[ax.HOffset 2*ax.VOffset+subax.VSize subax.HSize subax.VSize])

How to add labels on each line and add 2nd y-axes to the right side of the 'loglog' plot?

会有一股神秘感。 提交于 2019-12-11 12:33:33
问题 Recently I am trying to implement the ISO classification for the roadway assessment. Please refer to the paper The use of vehicle acceleration measurements to estimate road roughness. But I bumped into some questions about plotting the ISO classification graph. The code is shown as follows: %% generate ISO Clasification Curve (m^2/(rad/m)) AngSpaFre = 10^(-3):0.01:10^2; % spatial frequency (rad/m) ParamTable = [0 1*10^(-6) 2*(10^(-6)); % ISO classification parameters 2*(10^(-6)) 4*(10^(-6)) 8

Replace a certain color in an image with another color Matlab

时光怂恿深爱的人放手 提交于 2019-12-11 12:08:26
问题 I have an image that I opened in Matlab using imshow and I want to replace the color of every pixel with value (140,50,61) with a new color (150,57,80). If anyone could please advise how I can do this. 回答1: Assuming A to be the input image data, this could be one approach - %// Initialize vectors for old and new pixels tuplets oldval = [140,50,61] newval = [150,57,80] %// Reshape the input array to a 2D array, so that each column would %// reprsent one pixel color information. B = reshape

How to get the handles of all open App Designer apps (uifigures)?

↘锁芯ラ 提交于 2019-12-11 12:03:47
问题 As mentioned in a related answer, it is possible to get the handles of all open figures using: hFigs = findall(groot, 'Type', 'figure'); but this results in a list that contains both "old" figure and "new" uifigure handles. How can I separate hFigs into two lists, one containing only figure and the other only uifigure references? 回答1: To distinguish between figure and uifigure objects programatically, we can use a slight adaptation of what I suggested here: function tf = isUIFigure(hFigList)

Matlab plot label's text is unreadable

僤鯓⒐⒋嵵緔 提交于 2019-12-11 11:59:37
问题 first of all, I'm a newbie with Matlab. I just use it because I need the Control System Toolboox for my university. Yesterday, I launched this script: % % Esempio 11.2 % clear all close all clc % numG=10; denG=conv([10 1],[5 1]);denG=conv(denG,[1 1]); G=tf(numG,denG); % numRA=8*denG; denRA=conv([250 1],[0.4 1]);denRA=conv(denRA,[0.4 1]); RA=tf(numRA,denRA); numRB=8*conv([10 1],[5 1]); denRB=conv([250 1],[0.4 1]); RB=tf(numRB,denRB); numRC=8*conv([5 1],[1 1]); denRC=conv([0.02 1],[0.02 1]); RC

How to plot an equilateral color triangle?

爷,独闯天下 提交于 2019-12-11 11:59:28
问题 I would like to make a color plot in MATLAB similar to this plot: I have managed to create all the points [x,y] needed in order to create the vertexes and I have a map with colors of each vertex, so I can get the following. But I do not get it how to make the axis work. Code so far: % Equilateral grid tcorner = [0.0, 0.5, 1.0; 0.0, 1.0*sqrt(3)/2, 0.0]; tg = triangle_grid( 1/0.05, tcorner ); tgx = tg(1,:); tgy = tg(2,:); % Create triangles tri = delaunay(tgx,tgy); % Plot h = trisurf(tri, tgx,

Save axes handle when plotting In MATLAB

一世执手 提交于 2019-12-11 11:57:30
问题 I have script handling figures so that I can print and input them in a latex document with scale = 1 and everything looks nice. In this context I want to save the figure, axes and legend handles. Is there a way to save them like when using fig = figure . I know two 'hacks' 1) nfig = nfig+1; fig = figure(nfig); plot() ax = gca leg = legend() 2) nfig = nfig+1; fig = figure(nfig); ax = subplot(1,1,1) plot() leg = legend() My script function fig_set(fig,ax,leg,width,heigth,font_size) %% fig_set

How to plot Inequalities using (plot::Inequality) in matlab

爱⌒轻易说出口 提交于 2019-12-11 11:44:40
问题 I want to plot some Inequalities with matlab. I am using this code: figure; plot(plot::Inequality(x^2 + y^2 < 1, x = -1.5..1.5, y = -1.5..1.5)); But i am getting this error: plot(plot::Inequality(x^2 + y^2 < 1, x = -1.5..1.5, y = -1.5..1.5)) | Error: Unexpected MATLAB operator. I have read this manual. and something more: >> version ans = 8.0.0.783 (R2012b) 回答1: plot::Inequality is part of Matlab's symbolic toolbox and is invoked from within MuPAD. You cannot use it like a regular command. 来源