figure

How can I set subplot size in MATLAB figure?

陌路散爱 提交于 2019-12-03 09:50:13
问题 I often need to plot 10 images together, but using this code results in small images : img = rand(400,600); for i=1:10 subplot(2,5,i); imshow(img); title(['Image ' int2str(i)]); end As you can see, the images do not use all available space in the screen. How can I increase the size, or decrease the padding/margin between them? Thanks for any help. 回答1: I don't believe there is an easy way to do it. There are two options: First, use the position part of the subplot: >> subplot(2,5, i, [l, b, w

In matlab, how do you save a figure as an image in the same way as using “Save As…” in the figure window?

丶灬走出姿态 提交于 2019-12-03 06:56:49
When saving a figure, what function does Matlab use? For example, when a user selects File > Save As... and then selects .png or another image format, what is going on behind the scenes? I am asking because I am trying to automate saving, but when I use saveas or print , the resulting image is really pixelated. However, the image looks really good when I save the figure using the method described above. What method should I use to save my figure from the command line? The actual method that the figure window uses would work, but if you guys have better solutions, I'd appricate it! The callback

Save MATLAB figure with different background color

若如初见. 提交于 2019-12-03 05:27:58
I want to print a MATLAB figure with a dark background and white labels. If I use the print or saveas command I lose somehow the colors. The plot symbols are dark again and the background is white. points = rand(100,3); plot3(points(:,1),points(:,2),points(:,3),'*w') grid on set(gca,'Color',[0.5 0.5 0.5]) saveas(gcf,'test1','pdf') saveas(gcf,'test2','png') print(gcf,'test3.pdf','-dpdf') All three test files end up being wrong. If I choose "Save As" in the figure menu I am able to save the figure correctly. Any ideas how to resolve the issue? To keep the background as in your figure, use the

what is the usage of HTML5 figure with img

余生颓废 提交于 2019-12-03 04:15:50
Is there any specific advantage/usage of using HTML5 <figure> over <img> ? I think <figure> is useless without <figurecaption> , isn't it? It will be helpful if explain with an example. NullPoiиteя Images are not technically inserted into an HTML page, images are linked to HTML pages. The <img> tag creates a holding space for the referenced image. While the content of the <figure> element is related to the main flow, its position is independent of the main flow, and if removed it should not affect the flow of the document From http://dev.w3.org/ The img element represents an image. and the The

MATLAB subplot title and axes labels

萝らか妹 提交于 2019-12-03 03:24:11
I have the following script to ultimately plot a 4 by 2 subplot: files = getAllFiles('preliminaries'); n = size(files); cases = cell(1, n); m = cell(1, n); for i = 1:1:n S = load(files{i}); cases{i} = retransmission_distribution(S); c = size(cases{i}); m{1,i} = cell(1, c(2)); %figure(i); str_size = size(files{i}); title_str = files{i}(5:str_size(2) - 4); title_str = strrep(title_str, '_', ' '); %title(title_str); for j = 1:1:c(2) [x, y] = hist(cases{i}{1,j}); m{1,i}{1,j} = [x; int32(y)]; % subplot(4, 2, j); % xlabel('Number of Retransmissions'); % ylabel('Number of Occurrences'); % bar(y, x,

Latex: Text cannot be placed below image

时光毁灭记忆、已成空白 提交于 2019-12-03 00:30:08
I'm having a problem with an image and some text. I have this code: Some text...\\ \begin{figure}[ht] \centering \includegraphics[scale=0.75]{picture.jpg} \caption{The caption} \label{fig:picture} \end{figure} Some more text... Basically, I want this: Some text. (Above image in the code) [end of page / new page] image Some more text. (Below the image in the code) [start of new section] But, what the above code gives me is this: Some text. (Above image in the code) Some more text. (Below the image in the code) [end of page / new page] image [start of new section] Latex insists on putting

How can I set subplot size in MATLAB figure?

泪湿孤枕 提交于 2019-12-03 00:18:01
I often need to plot 10 images together, but using this code results in small images : img = rand(400,600); for i=1:10 subplot(2,5,i); imshow(img); title(['Image ' int2str(i)]); end As you can see, the images do not use all available space in the screen. How can I increase the size, or decrease the padding/margin between them? Thanks for any help. I don't believe there is an easy way to do it. There are two options: First, use the position part of the subplot: >> subplot(2,5, i, [l, b, w, h]) and calculate the left, bottom, width, height. Or, get the handle of the returned axis: >> h(i) =

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

How to reverse the axis in ILNumerics

南楼画角 提交于 2019-12-02 14:26:22
问题 I want to reverse the Y axis in ILLinePlot from top to bottom (from descending become ascending). My result is like this: here is the code: scene.Add(new ILPlotCube { new ILLinePlot(ILMath.tosingle(ZDistance["1,0;:"]), markerStyle: MarkerStyle.Dot) }); How to reverse the Y axis become like this figure? 回答1: Turn the plot cube around the X axis by 180°: ilPanel1.Scene.Add(new ILPlotCube { Children = { new ILLinePlot(ILSpecialData.sincos1Df(200,1)[":;0"].T) }, Rotation = Matrix4.Rotation(new

Python keeps overwriting hist on previous plot but doesn't save it with the desired plot

强颜欢笑 提交于 2019-12-02 07:58:06
I am saving two separate figures, that each should contain 2 plots together. The problem is that the first figure is ok, but the second one, does not gets overwritten on the new plot but on the previous one, but in the saved figure, I only find one of the plots : This is the first figure , and I get the first figure correctly : import scipy.stats as s import numpy as np import os import pandas as pd import openpyxl as pyx import matplotlib matplotlib.rcParams["backend"] = "TkAgg" #matplotlib.rcParams['backend'] = "Qt4Agg" #matplotlib.rcParams['backend'] = "nbAgg" import matplotlib.pyplot as