matlab-figure

Saving .fig file from Octave

时光怂恿深爱的人放手 提交于 2019-12-05 04:26:43
I need to make a .fig file that can be reopened in Matlab, but I am working in Octave. But apparently there is no saveas command in Octave. This is what I am trying: octave:3> plot([1,2,3],[45,23,10]) octave:4> saveas(gcf,'myfig.fig') error: `saveas' undefined near line 4 column 1 octave:4> Currently the Matlab fig file format is a proprietary binary file format. Octave doesn't know how to export to this format and won't be able to until it is reverse engineered. The fig format that Octave knows about is a different fig format used by Xfig with the same extension name, but nothing else in

Scatter pie plot

坚强是说给别人听的谎言 提交于 2019-12-04 14:42:39
I'm trying to visualize a soft clustering. There are a number of points and a small number of clusters, each point belongs to each cluster with some probability. Currently, I'm overlaying a scatterplot for each cluster, with the size of 'o' markers varying by the probability. This allows easy identification of the most probable cluster, but not much beyond that. I'd like to draw a scatterplot of pie charts, i.e. one small pie chart for each of the many data points, showing these probabilities. Is that possible in Matlab? I haven't found a way to draw pies as markers or place multiple pie

How to create an interpolated colormap or color palette from two colors? [duplicate]

拈花ヽ惹草 提交于 2019-12-04 14:32:57
问题 This question already has answers here : How to create a custom colormap programmatically? (2 answers) Closed 3 years ago . I'd like to create a color palette between two colors. For instance between Blue and Red with 20 or 50 instances. How can this be achieved in Matlab R2014b? 回答1: You can use any kind of interpolation (e.g. interp1) to create your own custom colormap between two colors or multiple colors. A colormap is basically a 3-column matrix with RGB-values. In your case its pretty

use marker fill colors according to data value in MATLAB

独自空忆成欢 提交于 2019-12-04 12:57:31
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 the squares according to data in the 3rd column ? Basically how do i go about color coding the 2nd

MATLAB Figure Rendering: OpenGL vs. Painters?

白昼怎懂夜的黑 提交于 2019-12-04 11:27:23
I'm clueless when it comes to which renderer to use for MATLAB figures or when it matters, but I have come across certain examples where it does matter: plot(0,0,'ko','markersize',50,'linewidth',8); set(gcf,'renderer','opengl'); set(gcf,'renderer','painters'); Left=OpenGL, Right=Painters: (running Windows 7 Professional and MATLAB R2015b) Are there times when using the OpenGL renderer produces better results than Painters? In general how do the two renderers differ? These are the differences I know of OpenGL is the default renderer OpenGL allows to plot transparency and Painter does not If

Moving MATLAB axis ticks by a half step

半城伤御伤魂 提交于 2019-12-04 09:49:03
I'm trying to position MATLAB's ticks to line up with my grid, but I can't find a good way to offset the labels. Also, if I run set(gca,'XTickLabel',1:10) , my x tick labels end up ranging from 1 to 5. What gives? You need to move the ticks, but get the labels before and write them back after moving: f = figure(1) X = randi(10,10,10); surf(X) view(0,90) ax = gca; XTick = get(ax, 'XTick') XTickLabel = get(ax, 'XTickLabel') set(ax,'XTick',XTick+0.5) set(ax,'XTickLabel',XTickLabel) YTick = get(ax, 'YTick') YTickLabel = get(ax, 'YTickLabel') set(ax,'YTick',YTick+0.5) set(ax,'YTickLabel',YTickLabel

Expand (maximise) subplot figure temporarily — then collapse it back

独自空忆成欢 提交于 2019-12-04 09:10:43
Often in Matlab we would plot a figure with many subplot axes, but they are all tiny. In the prevalent UX paradigm, you would expect to be able to double-click such a small plot to have a closer look using the entire screen space. Typically this is the reason I avoid using subplot , but plot many individual figures instead — so I can move them around on the screen and double-click on their titlebars which (on Windows) maximises the figure to full screen. (Double-click again, and it returns to its normal size.) However, the advantage of subplot is that the set of plots is grouped in one panel.

How to extract data from figure in matlab?

做~自己de王妃 提交于 2019-12-04 08:28:10
I have saved different Matlab plots in an unique .fig. The figure is like this: Now, I would like to introduce a filter in these plots to reduce the noises, but unfortunately I have lost the code that generates these signals. Is there a way to extract data of each signal in this figure? I tried this: open('ttc_delay1000.fig'); h = gcf; %current figure handle axesObjs = get(h, 'Children'); %axes handles dataObjs = get(axesObjs, 'Children'); %handles to low-level graphics objects in axes objTypes = get(dataObjs, 'Type'); %type of low-level graphics object xdata = get(dataObjs, 'XData'); %data

MATLAB how to automatically read a number of files

て烟熏妆下的殇ゞ 提交于 2019-12-04 06:54:16
问题 I would like to plot a number of 3D graphs from different data files. For example I am using fid = fopen('SS 1.dat','r'); to read the first file and then plot a graph. How to set the program to change the name to 'SS 2.dat' automatically? Also for the tenth file the name becomes 'SS 10.dat' which has one space less (i.e.only two space between SS and 10) then the first to ninth files. How to set the program to adjust for that? Thank you. 回答1: The following code displays a lazy way to print the

How I can get specific values from Matlab Figure

﹥>﹥吖頭↗ 提交于 2019-12-04 06:54:15
问题 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. 回答1: hc=get(gca,'children'); data=get(hc,{'xdata','ydata'}); t