matlab-figure

How to add a x-axis line to a figure? (matlab)

限于喜欢 提交于 2019-12-03 04:25:31
问题 I want to add a x-axis line at 0 to a matlab figure so that I can compare my data to see if it is positive or negative when saving the figures to a jpg. What is the best way to do this? I know you can use line() but it just seems cumbersome because you need to specify the x and the y ranges. Is there an easier way? Thanks! 回答1: I don't believe there is a built-in way that is more convenient. I use hline() and vline() from FileExchange, which work like a charm: http://www.mathworks.com

Distance between axis label and axis in MATLAB figure

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 20:57:01
I'm plotting some data with MATLAB and I'd like to adjust the distance between axis label and the axis itself. However, simply adding a bit to the "Position" property of the label makes the label move out of the figure window. Is there a "margin" property or something similar? In the above figure, I'd like to increase the distance between the numbers and the label "Time (s)" while automatically extending the figures size so that the label does not move out of bounds. This is how I set up the figure / axis. figure; set(gca, ... 'Box' , 'off' , ... 'LooseInset' , get(gca, 'TightInset') * 1.5 , .

Limit of figure dimensions

家住魔仙堡 提交于 2019-12-02 20:06:18
问题 During the answering this question and issues, unrelated to the question, with creating figures with really high height I've found that figures are cropped. If 'units' properties of figure's children is set to 'normalized' the appropriate child is shrunk rather than cropped. The question is, why is the height of figure limited and what (property) rules that limit. It looks like I'm limitted to figure height of 9.94" (Dell Latitude E5500; Win7 enterpise, 32-bit; matlab 2011b; resolution

is it possible to speed-up matlab plotting by calling c / c++ code in matlab?

不羁岁月 提交于 2019-12-02 19:25:22
It is generally very easy to call mex files (written in c/c++) in Matlab to speed up certain calculations. In my experience however, the true bottleneck in Matlab is data plotting. Creating handles is extremely expensive and even if you only update handle data (e.g., XData, YData, ZData), this might take ages. Even worse, since Matlab is a single threaded program, it is impossible to update multiple plots at the same time. Therefore my question : Is it possible to write a Matlab GUI and call C++ (or some other parallelizable code) which would take care of the plotting / visualization? I'm

How to add a x-axis line to a figure? (matlab)

ぃ、小莉子 提交于 2019-12-02 17:39:19
I want to add a x-axis line at 0 to a matlab figure so that I can compare my data to see if it is positive or negative when saving the figures to a jpg. What is the best way to do this? I know you can use line() but it just seems cumbersome because you need to specify the x and the y ranges. Is there an easier way? Thanks! I don't believe there is a built-in way that is more convenient. I use hline() and vline() from FileExchange, which work like a charm: http://www.mathworks.com/matlabcentral/fileexchange/1039 There exist an undocumented function graph2d.constantline : plot(-2:5, (-2:5).^2-1)

How can I multiple plot in one figure at Matlab?

◇◆丶佛笑我妖孽 提交于 2019-12-02 14:11:44
问题 Hi I'm trying to implement as following code. plot(bins,r); plot(bins,g); plot(bins,b); But I want to plot in one figure. Is there any way? 回答1: For multiple plots in the same figure and not the same axis. You have to use subplot(x,y,z). The first argument 'x' is the number of plot you want to produce, in your case 3. Second 'y' just adjusts the size of the plots, you can use 1. The third 'z' is the position of the plot, whether a certain plot comes first, second or third. subplot(3,1,1) plot

How I can get specific values from Matlab Figure

為{幸葍}努か 提交于 2019-12-02 12:54:56
I want to get some specific values from a Matlab Figure. The number of values can be 3, 5, 10, 50 or any N integer. Like in sample pictures, I want to get values of A, B, C. in form of e.g A=(430,0.56). A,B,C are not the part of Plot. I just wrote them in Photoshop help clarify the question. Note: On every execution of the code input values can be different. The length of the input values (Graph Values) can also change every time. hc=get(gca,'children'); data=get(hc,{'xdata','ydata'}); t=data{1}; y=data{2}; tA=250;tB=1000; %tA is starting Point and tB is the last point of data as ur figure

Converting image using matlab / octave from rgb to hsv back to rgb

有些话、适合烂在心里 提交于 2019-12-02 12:46:34
I'm trying to convert a color image from rgb to hsv (make changes) then back to rgb. As a test I made this code just to test how to go from rgb to hsv back to rgb but when I view the image it just shows up as black. What am I missing? *PS I'm using octave 3.8.1 which works like matlab Here are the octave 3.8.1 packages I have loaded: >>> pkg list Package Name | Version | Installation directory --------------+---------+----------------------- control *| 2.6.2 | /usr/share/octave/packages/control-2.6.2 general *| 1.3.4 | /usr/share/octave/packages/general-1.3.4 geometry *| 1.7.0 | /usr/share

Ploting a wave with different colors in the same figure [duplicate]

穿精又带淫゛_ 提交于 2019-12-02 11:51:32
This question already has an answer here: Plotting piecewise function 1 answer How can I plot a wave (represented by 1 x N matrix) with different colors in matlab. The range for a specific color can be provided manually. See the diagram below for the expected output. Here is a simple option: x = linspace(-4*pi,4*pi,10000); % some data y = -sin(x); % some data N = 4; py = reshape(y,[],N); px = reshape(x,[],N); plot(px,py,'LineWidth',2) Where y is your vector, and N is the number of pieces you want to distinguish. Note that you have to make sure that y is dividable by N with no remainder. If you

Plot a big figure with many subfigures in matlab

北城余情 提交于 2019-12-02 11:50:11
问题 I have to print a large poster, containing a matrix of figures, and it would be very practical for me to let MATLAB arrange them. Unluckily, subplots are displayed to fit a certain figure size, so are tiny and distorted. Instead of fitting the figure size, I would like to fit the paper size of my poster. I have tried with set(gcf,'Position'..) , and also changing papersize, but I still don't see the expected result. Is there something I can try to let MATLAB use, say, a whole A0 sheet to plot