matlab-figure

White space on the right when using bar Matlab

核能气质少年 提交于 2019-12-02 01:42:36
问题 I'm using the below code to save a figure: fig1=figure('visible','off'); b = bar(bar_res); x={'a' ;'b' ;'c'; 'd' ;'e'; 'f' ;'g'; 'h';... 'i'; 'j' ;'k'; 'l'; 'm'; 'n' ;'o'; 'p' ;'q' ;'r'; 's';... 't';'u'}; set(gca,'XTickLabel',x,'XTick',1:21); rotateXLabels( gca, 90 ); with=char('Res with dash'); without=char('Res without dash'); legend('Reference',with,without,'Location','northwest'); set(gca,'FontSize',16); y=ylabel('Number of trials','rot',90,'FontSize',18); set(y,'Units','Normalized',

How can I control which monitor plots are displayed on?

不羁岁月 提交于 2019-12-02 01:29:29
I have a 3 monitor Gentoo Linux system running MATLAB. MATLAB runs on the center monitor. I need MATLAB to generate plots on the left monitor but it always plots on the right monitor. I believe this is at least partially caused by the non-standard way I have my monitors arranged physically - essentially 2,3,1: >> get(0,'MonitorPositions') ans = 1 1 1920 1080 -3839 1 1920 1080 -1919 1 1920 1080 Is there a way I can control this as a default within MATLAB? You can set the default figure position on the root object like so: set(0, 'DefaultFigurePosition', [-3839 1 1920 1080]); This will create

Matlab Plot - Font Zapf Dingbats Will Not Render

谁说胖子不能爱 提交于 2019-12-02 01:29:10
问题 I have a Matlab program where I need to include a plane icon (Zapf Dingbats 40) in the plot. Everytime I run it, it falls back to a system font. Is there anything that I am doing wrong? This is not the exact code, but illustrates the problem: title(char(40),'fontname','ZapfDingbats','fontsize',50); The resulting plot always displays ( instead of the Dingbats plane icon ✈ . I verified that the font is installed and I can type with it on Word. I am using Matlab R2013b on Mac OSX 10.9.1 . EDIT:

Area between line and curve (no function)

淺唱寂寞╮ 提交于 2019-12-02 01:14:21
问题 I want to calculate the area beween the orange and the blue line. I managed to shade the area. But I do not know how to apply the trapz function in order to get the area. In this post: Area under surface between two curves I got some solutions but I do not have a specific equation for the curves just the plots per se. The code for the orange line is: x_1 = [0,M1_1]; y_1 = [c1,c1]; v = plot(x_1,y_1,'LineWidth',2) The blue curve is a plot of arrays with the length of (10000x1)-abscissa and

White space on the right when using bar Matlab

谁都会走 提交于 2019-12-02 01:03:13
I'm using the below code to save a figure: fig1=figure('visible','off'); b = bar(bar_res); x={'a' ;'b' ;'c'; 'd' ;'e'; 'f' ;'g'; 'h';... 'i'; 'j' ;'k'; 'l'; 'm'; 'n' ;'o'; 'p' ;'q' ;'r'; 's';... 't';'u'}; set(gca,'XTickLabel',x,'XTick',1:21); rotateXLabels( gca, 90 ); with=char('Res with dash'); without=char('Res without dash'); legend('Reference',with,without,'Location','northwest'); set(gca,'FontSize',16); y=ylabel('Number of trials','rot',90,'FontSize',18); set(y,'Units','Normalized','Position',[-0.15, 0.5, 0]); savefig('a.fig'); saveas(gca, 'a.png'); But I don't know why there is extra

Matlab Image and Plot with Unexpected Flip

我与影子孤独终老i 提交于 2019-12-02 00:16:39
In the examples below, there are some obvious code differences in each case, but I don't understand how they would change the orientation of the image or the plot, as shown in each case. The original image has a size of 407 x 813 x 3. For the data in the contour, X ranges from -180 to +175, Y ranges from -85 to +85 For the image, I am trying to fit it so that X ranges from -180 to +180, Y ranges from -90 to +90. So the image covers a slightly wider geographic range than the image does. I have a contour plot of some geographic data. It plots like this, and looks like I expect it to look: The

Re-use the view output matrix in Matlab

我的未来我决定 提交于 2019-12-01 23:53:17
In Matlab, I create a fairly complicated 3D plot, then manipulate the view option by hand up to a point where I am happy with what I see (below). How can I reuse the parameters of the final view? I can get the output of the view command which is a 4 by 4 matrix, but the latter does not seem to be reusable? In order to get something out of view that you can then pass to view to reconstruct the viewpoint, you need to specify two outputs to view which will yield the current azimuth and elevation. [az, el] = view(ax1); You can then pass these to view on a different (or the same) axes to specify

How to label x-axis with dates?

淺唱寂寞╮ 提交于 2019-12-01 23:07:00
I cant seem to figure out how to plot dates in Matlab that aren't in numerical order. The dates I need are from January 22nd to Feburary 1st, but when I put it in Matlab it goes in numerical order starting from the 1st. So I was wondering how to get it so that it goes in order of the list I have. Here is the code I've made: date = [22 23 24 25 26 27 28 29 30 31 1 2 3 4]; in_bed = [3 8 26 76 225 298 258 233 189 128 68 29 14 4]; convalescent = [0 0 0 0 9 17 105 162 176 166 150 85 47 20]; plot(date,in_bed,'*',date,convalescent,'*') xlabel('Janurary -- Feburary') ylabel('Number of Cases') legend(

Matlab Plot - Font Zapf Dingbats Will Not Render

a 夏天 提交于 2019-12-01 22:13:01
I have a Matlab program where I need to include a plane icon (Zapf Dingbats 40) in the plot. Everytime I run it, it falls back to a system font. Is there anything that I am doing wrong? This is not the exact code, but illustrates the problem: title(char(40),'fontname','ZapfDingbats','fontsize',50); The resulting plot always displays ( instead of the Dingbats plane icon ✈ . I verified that the font is installed and I can type with it on Word. I am using Matlab R2013b on Mac OSX 10.9.1 . EDIT: It prints correctly to a pdf, but does not display correctly. You may use the 'Wingdings' font for that

MATLAB Colorbar - Same colors, scaled values

纵饮孤独 提交于 2019-12-01 21:52:49
问题 Consider the following example: [ X, Y, Z ] = peaks( 30 ); figure( 100 ); surfc( X, Y, Z ); zlabel( 'Absolute Values' ); colormap jet; c = colorbar( 'Location', 'EastOutside' ); ylabel( c, 'Relative Values' ); The output looks as follows: How can I scale the ticks on the colorbar, i.e. scale the c-axis (e.g. divide the values by 100): without changing the z values and colors on the plot without changing the colors on the colorbar without changing the relation between the colors on the plot,