figure

Text and background-color overlay on image

ぐ巨炮叔叔 提交于 2019-12-04 06:41:35
I'm trying to create a solid-color overlay that exactly matches the size of an image, and display text on that overlay. I'd like to do this with HTML and CSS only, if possible. The image may be of any size, and will be sized to fit and centered within its parent container. Something like this (which does not work): HTML: <div class="img-overlay"> <img src="file.jpg"> <div class="overlay">Text will flow...</div> </div> CSS: .img-overlay img { margin: 0 auto; max-height: 100%; } .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100% background-color: rgba(255,255,255,0.5); } I

Figure size in R Markdown

和自甴很熟 提交于 2019-12-04 04:13:40
问题 I tried to be careful and thorough, to read various things on the net on how to format figures in R Markdown. They are plotted correctly, but it seems that their size cannot be controlled. Firstly, there are basics, like: ```{r Fig1, echo=FALSE, fig.height=5, fig.width=15} x1 = rnorm(100) x2 = runif(100) x3 = rbeta(100, 1, 1,) par(mfrow=c(1,3), mar=c(4,4,4,1), oma=c(0.5,0.5,0.5,0)) qqnorm(x1) qqnorm(x2) qqnorm(x3) ``` Then, I try a bit more with: ```{r Fig1b, echo=FALSE, fig.height=5, fig

How to position an axes in a figure relative to another axes?

折月煮酒 提交于 2019-12-04 03:57:01
When laying out a figure in MATLAB, typing axis equal ensures that no matter what the figure dimensions, the axes will always be square: My current problem is that I want to add a second axes to this plot. Usually, that's no problem; I would just type axes([x1 y1 x2 y2]) , and a new square figure would be added with corners at (x1, y1), (x2, y2) , which is a fixed location relative to the figure . The problem is, I want this new axes to be located at a fixed location relative to the first axes . So, my questions are: Does anyone know how I can position an axes in a figure by specifying the

Pickle figures from matplotlib

梦想的初衷 提交于 2019-12-04 03:22:50
问题 I am trying to recreate the simple pickle figure example from the question: Saving interactive Matplotlib figures, which is also sourced from Saving Matplotlib Figures Using Pickle. However, when I run the given codes the figures seems to pickle OK, but then I get an error when I try to load the pickled figure. I am running it using Canopy Enthought (v1.6.2.3262), using Matplotlib 1.5.1-1 and Numpy 1.9.2-3 on Python 2.7.3-1. The pickle code is:` import numpy as np import matplotlib.pyplot as

Removing the edge line on a contour plot

痞子三分冷 提交于 2019-12-03 20:13:52
I used Matlab to create a polar coordinate and converted it into Cartesian coordinate. [th,r] = meshgrid((0:0.5:360)*pi/180,0:.02:1); [X,Y] = pol2cart(th,r); I get data on this mesh and produce a contourf plot over it. My problem is that I get a center line in my contourf plot which I would like to remove, could some help me with this Thank you If I extend a little bit your example to get something I can plot, I do reproduce the problem: [th,r] = meshgrid((0:0.5:360)*pi/180,0:.02:1); [X,Y] = pol2cart(th,r); Z = sqrt( X.^2 + Y.^2 ) ; isoLevel = 0:0.1:10 ; [C ,hc] = contourf(X,Y,Z,isoLevel) ;

python and update figure in matplotlib

我怕爱的太早我们不能终老 提交于 2019-12-03 14:19:51
I've done a search on SO but haven't quite found the right "solution" to my problem. I am running a loop on some data that I wish to plot. At each step of the loop -- I plot the figure with plt.show(). However, since this is a blocking function, i am stuck until I manually close the window and then the loop continues and the next plot shows up. What I would like to do is be able to bind a key press event to close the figure and continue the loop (rather than using the mouse to "X" out of the figure). If this is not possible, I would like to set a timer to close the figure and continue the loop

MATLAB subplot title and axes labels

拈花ヽ惹草 提交于 2019-12-03 14:13:03
问题 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)]; %

How to control font size in png?

帅比萌擦擦* 提交于 2019-12-03 13:42:43
问题 I am trying to make figures for a manuscript, that should be written with MS Word, which does not accept figures in pdf format. The journal asks first draft with figures embedded in the Word file. These figures should have resolution minimum of 300 dpi and have a width of either 169 mm or 81 mm (two/one column). I notice that when I specify the resolution of the picture to 300 (res = 300), the font size is bound to this value. This works fine with some figures (the first example, example.png)

what is the usage of HTML5 figure with img

时光怂恿深爱的人放手 提交于 2019-12-03 10:30:17
问题 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. 回答1: 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

Latex: Text cannot be placed below image

你。 提交于 2019-12-03 09:53:38
问题 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