matlab-figure

How to plot x=0 in semilogx plot?

本秂侑毒 提交于 2019-12-06 14:16:56
I need to plot a graph using semilogx(x,y) . I have x=[0 1 2 ... 10 15 20 30 50 75 100] . The problem is that MATLAB does not plot x=0 , which I understand because log(0)=undef . So is there another method in MATLAB to spread my points? Because using linear scale squeezes all first points in 1/10th of the graph's width! Usually, what is done in cases like this is adding 1 to all x , so the first value (originally 0 ) appears at the origin, and also the back-transformation is the same for all values. You can add any other small values than 1 , and get a similar result. However, you don't want

Matlab graph plotting - Legend and curves with labels

▼魔方 西西 提交于 2019-12-06 14:05:28
How to plot a figure like the one given below? Here the legend (green/blue) is plotted with some values (0.10 to 0.40) on each curve. Is there any possible solution or hints to do this? Figure Reference: Plotting data labels within lines is possible with clabel (contour labels), although this requires that you to plot your data with the contour command. Although if you can't plot it as a contour plot then you should be able to convert your plot data to a contour matrix format, see the matrix definition at the bottom of the help page on the contour algorithm . This is a simple 2 row vector

Impossible Viewpoint using Azimuth and Elevation

Deadly 提交于 2019-12-06 12:12:29
I can't seem to achieve the following 3D plot view orientation using the view([AZ,EL]) command. No matter how hard I try rotating my 3D plot in the figure using the mouse or the command view itself, I just can't get that viewing angle. Is there another way of specifying the viewpoint? You can achieve these sorts of views using camera control functions , in this case camorbit and camroll : [X, Y, Z] = peaks(); hAxes = gca; surf(hAxes, X, Y, Z); xlabel('x'); ylabel('y'); zlabel('z'); camorbit(-90, 0); camroll(hAxes, -111); Notice that positive x is pointing up and to the right, positive z is

How to close all neural network diagrams in MATLAB?

回眸只為那壹抹淺笑 提交于 2019-12-06 11:27:10
I need to show diagrams of some networks, but the problem is that close all doesn't close these windows, so I have several windows to close manually after a few runs. [x,t] = house_dataset; net1 = newff(x, t, [5, 3]); view(net1); net2 = newff(x, t, [7, 5]); view(net2); close all; However if I keep the handle of window, close function will close it: net3 = newff(x, t, [9, 7]); h = view(net3); close(h); But it's not easy for me to collect all those handles. How can I find all those handles programmatically? You can use the command: nnet.guis.closeAllViews() This will close all the diagrams for

Plot vector field within given region (between two circles) in matlab

可紊 提交于 2019-12-06 09:08:24
I want to plot below vector field in Matlab: u = cos(x-x_0).*y-y_0; v = sin(x+x_0).*y+y_0; I can do it easily in a grid, for example from -2 to 2 in x and y direction: x_0=2; y_0=1; [x,y] = meshgrid(-2:0.2:2, -2:0.2:2); figure quiver(x,y,u,v) But I want to plot the vector field in a certain region which isn't square like above. The region I want to plot the vector field is the region between two circles, both centered at (x_0,y_0) with radii equal to r_1=5 and r_2=10 How can I do that? Set up your radii, centre of circle and x , y variables like so r1 = 5; r2 = 10; % Radii of your circles x_0

Scatter pie plot

[亡魂溺海] 提交于 2019-12-06 08:57:05
问题 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

How to save custom-sized figures [duplicate]

给你一囗甜甜゛ 提交于 2019-12-06 08:20:53
This question already has answers here : Closed 8 years ago . Possible Duplicates: Printing a MATLAB plot in exact dimensions on paper How do I save a plotted image and maintain the original image size in MATLAB? I have recently been trying to create a custom-sized graph in MATLAB and save it automatically using the saveas function. In particular, I am having issues saving the files in the size that I create them. Roughly speaking, my code is as follows: mygraph = figure('Position',[1,20,1280,1024]); % creates a figure positioned 1 px from the left of the screen % 20 px from the bottom of the

Error in MATLAB colorbar tick labeling?

こ雲淡風輕ζ 提交于 2019-12-06 07:22:51
I am plotting 9 subplots as shown in figure below with one color bar for three subplots. Here I want to show the highest value in color bar as > value , surprisingly when I manually edit the tick label as h.TickLabels{end} = ['>' h.TickLabels{end}]; the color bar starts repeating the value. When I remove h.TickLabels{end} = ['>' h.TickLabels{end}]; the color bar show no problem. When I change the figure size in set(gcf, 'PaperUnits', 'inches', 'PaperPosition', [0 0 8 8]) as [0 0 5 5] colorbar labeling again changes. How to resolve this error? Below are my working example and output image: data

MATLAB: Print contents of uipanel to PNG image

帅比萌擦擦* 提交于 2019-12-06 05:27:19
I don't know how to accomplish the following in MATLAB. I have a figure which looks like this: In the figure, I have a panel with many subplots and a scrollbar that allows me to view a portion of the panel. I want to save the whole contents of the panel to a PNG image file (not just the visible portion), i.e. I want to have a file which is a tall rectangle, and doesn't require scrolling. The code for generating the figure is as follows: function draw(obj) figure; panel1 = uipanel('Parent',1); panel2 = uipanel('Parent',panel1); panelheight = obj.nIterations / 2; set(panel1,'Position',[0 0 0.97

MATLAB Figure Rendering: OpenGL vs. Painters?

 ̄綄美尐妖づ 提交于 2019-12-06 05:19:30
问题 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? 回答1: These are the