matlab-figure

MATLAB: Changing the line properties of a loaded figure?

百般思念 提交于 2019-11-29 01:17:00
问题 I've got a very simple question, for MATLAB users: If I load a figure file (.fig) with the load command, is there any way to change the plotted lines properties from the command line? (width, color, marker, etc.) PD: The first two options according to the information in Defining the Color of Lines for Plotting On this page… only work if you use the plot command. Apparently they are useless if you load the figure. 回答1: You can get handles for all line objects on current figure with FINDOBJ

How to export non-blurry eps images?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 23:20:48
I'm exporting an image in Matlab using the eps format, but it smooths the image. Matlab does not blur the image using other formats such as png. I would like to know how to export a non-blurry image with eps format. Here is the resulting image using png: And here is the resulting image using eps: UPDATE: The problem is reproducible on a Mac, and the issue is with the eps renderer rather than MATLAB. For e.g., saving imagesc(rand(20)) and viewing with Preview and GSview results in the following: Preview screenshot GSview screenshot Clearly, the information is not lost. It is just not

How to merge two figure files into a single file

↘锁芯ラ 提交于 2019-11-28 22:01:41
This should be a problem with a trivial solution, but still I wasn't able to find one. Say that I have 2 matlab figures fig1.fig , fig2.fig which I want to load and show in the same plotting window. What should I do? I mean, I am pretty sure that I can accomplish the task using some low(er) level graphic command which extracts contents from one image and put them in the second one, nonetheless I cannot believe that there is not any high level function ( load fig2 on top of fig1 ) that does this...Comparing 2 plots (unfortunately already saved) is a very common task, I'd say. Its not clear if

Concatenating 2D plots

人走茶凉 提交于 2019-11-28 14:24:15
I have several 2D-plots in MATLAB. In each plot there are some lines (each line is a row-vector of values of fixed length). There is always a base line (black one) and the remaining colored lines may or may not be present. , . I need to concatenate all such plots into one plot as shown below: Please note these are just for representational purpose but explain my problem well. I am not able to figure how to do it. Anybody got an idea? An example may be? Also, there has to be a vertical gap between the successively concatenated plots as is shown in last figure. Some points to note: y-axis is of

How to use polar axes with Matlab warp?

戏子无情 提交于 2019-11-28 13:14:58
I want to use polaraxes on the warp object on the half circumference of the polar presentation. Code without polaraxes but with warp close all; clear all; clc; % https://stackoverflow.com/a/7586650/54964 load clown; img = ind2rgb(X,map); [h,w,~] = size(img); s = min(h,w)/2; [rho,theta] = meshgrid(linspace(0,s-1,s), linspace(0,pi)); [x,y] = pol2cart(theta, rho); z = zeros(size(x)); f1=figure(); hax=axes('Parent', f1); imagesc(img, 'Parent', hax); box(hax, 'off'); axis(hax, 'off'); set(hax, 'yTickLabel', []); set(hax, 'xTickLabel', []); % for polar presentation set(hax, 'Ticklength', [0 0]); %

Plot many horizontal Bar Plots in the same graph

核能气质少年 提交于 2019-11-28 12:58:07
I need to plot a x-y function, that shows the histograms at x-values. Something similar to the bottom plot of the next figure: I tried to use matlab's "barh", but can't plot many in the same figure. Any ideas? Or, maybe displacing the origin (baseline, basevalue in barseries properties) of successive plots would work. How could I do that for barh? thanks. Using 'Position' of axes property % generate "data" m = rand( 40,10 ); [n x] = hist( m, 50 ); % the actual plotting figure; ma = axes('Position',[.1 .1 .8 .8] ); % "parent" axes N = size(n,2); % number of vertical bars for ii=1:N, % create an

Semi-transparent markers in Matlab Figures

丶灬走出姿态 提交于 2019-11-28 12:05:45
I want to plot a scatter plot with filled markers and make them semi-transparent so when two or more markers overlap, the overlapping area will be more opaque. I naively thought sg = scatter(rand(1000,1),rand(1000,1), 'filled'); alpha(0.5) would work, but it doesn't. Also set(get(sg, 'Children'), 'FaceAlpha', 0.2) doesn't work. Any ideas? abcd AFAIK, you cannot change the alpha values of the plot markers in scatter . One solution would be to patch to draw markers yourself. Alpha values can be set for patch() objects and you will get the desired effect when markers overlap. However, this can

How to imshow with Invisible figure in MATLAB running on Linux

旧巷老猫 提交于 2019-11-28 10:35:37
My goal is to: Create an invisible figure Using subplots, plot images on it, and then Save it without having it to open. Thus, I am running the following code: f = figure('Visible', 'off'); subplot(2, 2, 1), imshow(image1); subplot(2, 2, 2), imshow(image2); subplot(2, 2, 3), imshow(image3); subplot(2, 2, 4), imshow(image4); saveas(f, 'filename'); But I get the error: Error using imshow (line xxx) IMSHOW unable to display image. This means that imshow is trying to display image. Is there a way to have imshow display image in the invisible figure and not try to pop up? This would work, f =

X-axis label on two rows

自古美人都是妖i 提交于 2019-11-28 09:37:23
问题 str = {'HS31'; 'HS31 (Ridotto)'; 'Dax85';'Dax85 (Ridotto)'; 'FTSE89';'FTSE89 (Ridotto)'; 'SP98';'SP98 (Ridotto)'; 'Nikkei22';'Nikkei225 (Ridotto)'; 'SP457';'SP457 (Ridotto)'; 'Russ1318';'Russ1318 (Ridotto)'; 'Russ2151';'Russ2151 (Ridotto)'; 'Eurostoxx';'Eurostoxx (Ridotto)'; 'Ftse';'HS31 (Ridotto)'; 'Mibtel';'Mibtel (Ridotto)'; 'SP';'SP (Ridotto)'; 'Nasdaq';'Nasdaq (Ridotto)'; }; h=figure; bar(t); set(gca, 'XTickLabel',str, 'XTick',1:numel(str)) saveas(h, 'Backtesting/computing_time.png'); I

How to change image axis labels

旧城冷巷雨未停 提交于 2019-11-28 09:26:36
I'm trying to change the image axis labels with some latitude/longitude but I can't find how to do it. I tried some basic commands like: imagesc(data) axis(meshgrid([-180:20:180],[-90:20:90])) colorbar but these expression appeared: imagesc(data),axis(meshgrid([-180:20:180],[-90:20:90])), colorbar Operands to the || and && operators must be convertible to logical scalar values. Error in axis>allAxes (line 448) result = all(ishghandle(h)) && ... Error in axis (line 57) if ~isempty(varargin) && allAxes(varargin{1}). Can anybody help me? FYI, my image axis labels are the data order (from 0 to N).