figure

Prevent paragraph from increasing the width of a floated parent

…衆ロ難τιáo~ 提交于 2019-12-10 10:58:49
问题 I often find myself using code blocks for inline article images like the following: ...article text. <div class="article-image right" style="width: 250px;"> <img src="..." width="250" alt="" /> <p class="caption">Potentially long image caption</p> </div> More article text... Or, the more succinct HTML5 version: ...article text. <figure class="right" style="width: 250px;"> <img src="..." width="250" alt="" /> <figcaption>Potentially long image caption</figcaption> </figure> More article text..

How to number floats in LaTeX consistently?

那年仲夏 提交于 2019-12-10 10:14:32
问题 I have a LaTeX document where I'd like the numbering of floats (tables and figures) to be in one numeric sequence from 1 to x rather than two sequences according to their type. I'm not using lists of figures or tables either and do not need to. My documentclass is report and typically my floats have captions like this: \caption{Breakdown of visualisations created.} \label{tab:Visualisation_By_Types} 回答1: The differences between the figure and table environments are very minor -- little more

python and update figure in matplotlib

谁说胖子不能爱 提交于 2019-12-09 12:34:02
问题 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

Save MATLAB figure with different background color

独自空忆成欢 提交于 2019-12-09 05:14:16
问题 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

Latex - Inserting a reference in a figure's caption

99封情书 提交于 2019-12-09 04:32:42
问题 In Latex, I want to add a reference in the legend of a figure, like: \begin{figure} ... \caption{This is the legend of this figure (reprinted from \cite{something}).} ... \end{figure} but the citation is not allowed to be placed in the the caption, only in the text. My bibliography is working on any other places of the text. Any suggestions how to do this? Thanks 回答1: Solution found: write \protect\cite{ref} instead of just \cite{ref} Or even shorter: '{\cite{ref}}' 回答2: As the accepted

What is the fastest/most efficient way to loop through a large collection of files and save a plot of the data?

一个人想着一个人 提交于 2019-12-08 08:42:56
问题 So I have this program that is looping through about 2000+ data files, performing a fourier transform, plotting the transform, then saving the figure. It feels like the longer the program runs, the slower it seems to get. Is there anyway to make it run faster or cleaner with a simple change in the code below? Previously, I had the fourier transform defined as a function, but I read somewhere here that python has high function calling overhead, so i did away with the function and am running

4D plot (3D+color) from 4 row vectors

故事扮演 提交于 2019-12-08 07:07:21
问题 I have 4 row vectors x, y, z and s , all of them have equal sizes 1*size . x, y, z should be the three Cartesian corodinate axes and s should be represented by colors (I want figure like below image). The statement Surf does not accept row vectors. I have read several stackoverflow post, but I could not find the answer. How can I plot such a figure? I really appreciate any help you can provide. 回答1: I can't test it because you didn't provide any data, but you could try: trisurf(x,y,z,s) If

writing “latex command” in the Matlab figure comment

旧城冷巷雨未停 提交于 2019-12-08 06:51:18
问题 I have a figure in Matlab, inside the figure i would like to write comments on the figure. the comment include latex formula; for example, I want to write this comment on my figure $$ \vec{R} = 2 $$ here is an example that I found when I searched; clear all; close all; clc; figure ms = 8; fontSize = 18; xx = 0:.1:1; plot(xx,sin(xx)) xlabel('P_{fa}', 'fontsize', fontSize); ylabel('P_{m}', 'fontsize', fontSize); I want it looks like as in the attached figure below: Note: I searched in last

Matplotlib - mark_inset with different edges for axes

独自空忆成欢 提交于 2019-12-08 05:13:38
问题 I want to plot a time series of a damped random walk in one subplot and then zoom into it in a second subplot. I know mark_inset from matplotlib, which works fine. The code I have so far is: from mpl_toolkits.axes_grid1.inset_locator import mark_inset from astroML.time_series import generate_damped_RW fig = plt.figure() ax = fig.add_subplot(111) ax0 = fig.add_subplot(211) ax1 = fig.add_subplot(212) ax.set_ylabel('Brightness[mag]') ax.yaxis.labelpad=30 ax.spines['top'].set_color('none') ax

Matplotlib - mark_inset with different edges for axes

廉价感情. 提交于 2019-12-08 02:46:25
I want to plot a time series of a damped random walk in one subplot and then zoom into it in a second subplot. I know mark_inset from matplotlib, which works fine. The code I have so far is: from mpl_toolkits.axes_grid1.inset_locator import mark_inset from astroML.time_series import generate_damped_RW fig = plt.figure() ax = fig.add_subplot(111) ax0 = fig.add_subplot(211) ax1 = fig.add_subplot(212) ax.set_ylabel('Brightness[mag]') ax.yaxis.labelpad=30 ax.spines['top'].set_color('none') ax.spines['bottom'].set_color('none') ax.spines['left'].set_color('none') ax.spines['right'].set_color('none'