figure

Beginner's questions (figures, bibliography) with Sweave/R/LaTeX---my first document

末鹿安然 提交于 2019-12-20 04:53:54
问题 I am just starting with Sweave and with R . Here I am using R to output some data and I am also trying to include a plot. The code does not sweave. I have one Sweave example from the web that compiles well in RStudio with LaTeX . \documentclass[a4paper]{article} \begin{document} <<echo=TRUE>>= x <- rnorm(100) xm <- mean(x) xm @ <<echo=FALSE>>= x <- rnorm(100) xm <- mean(x) xm @ <<echo=TRUE>>= test.frame<-read.table(file="apples.d",header=T,sep= "") names(test.frame) head(test.frame) class

Cannot move Matplotlib plot window and exit it using red X button

假装没事ソ 提交于 2019-12-20 03:56:13
问题 I'm running Python v3.5 and matplotlib v1.4.3 on Windows 10 Home . Up to recently, I write the python script using matplotlib with PyQt GUI. The ' plt.show() ' code will be written in another module not __main__ . When I run this code, Matplotlib figure cannot be moved and exit using red button X at the top of the right side of figure. Strangely, The chart is shown and It really does work well. Why does this symptom happens? and How can I revise it? 回答1: I stumbled on a similar problem. This

What does the index refer to when selecting a pixel on an image in Matlab?

夙愿已清 提交于 2019-12-20 03:42:49
问题 When looking at a single pixel of an image in Matlab, what does this index refer to? X/Y refer to the coordinates of the pixel, and RGB refers to the color, but any ideas on what the index is? To clarify, when I am viewing a figure in Matlab and use the data cursor to select a point, the three lines shown are: X: ### Y: ### Index: ### RGB: ###, ###, ### I am trying to "average" several dicom images together, and it appears that the numbers that are added and being manipulated is this index

How to create a reusable basemap

微笑、不失礼 提交于 2019-12-19 03:13:44
问题 In continuation to my previous question: How to superimpose figures in matplotlib i would like to know how can one create a reusable basemap object. My problem is that a basemap is not a pyplot object, so the solution i received works well on figures / axes but not on basemap objects. I tried to look around and find a solution, but couldn't find any, just discussions. 回答1: Thanks to @JoeKington here and @EdSmith at How to superimpose figures in matplotlib, i was able to understand how to

How can I extract data from a .fig file in MATLAB?

让人想犯罪 __ 提交于 2019-12-18 14:06:51
问题 I know this is really basic, but I am new to MATLAB. After opening a .fig file, how do you actually work with the plotted data in the command window? All I see is the plot. I'm not sure how to actually get the data. 回答1: Actually, you don't even have to display the figure in order to get the data. FIG files are stored in the standard Matlab MAT format, that you can read using the built-in load() function. The figure handles and data are stored in a structure that you can easily understand and

Matlab: Plot points and make them clickable to display informations about it

五迷三道 提交于 2019-12-18 12:38:45
问题 I have some points like this: matrix = rand(6, 4) 0.8147 0.2785 0.9572 0.7922 0.9058 0.5469 0.4854 0.9595 0.1270 0.9575 0.8003 0.6557 0.9134 0.9649 0.1419 0.0357 0.6324 0.1576 0.4218 0.8491 0.0975 0.9706 0.9157 0.9340 the first two columns are x and y values which get plotted as points via plot(matrix(:, 1), matrix(:, 2), '*r' Now what I want to work out is the following: Whenever I click on a certain point in the plot, I want the information out of column 3 and 4 being displayed as text just

How to change font size of x axis? [closed]

寵の児 提交于 2019-12-18 05:12:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Is there any way to change the font size property of x axis in MATLAB for a figure? I need to change the size of the values in x axis (not the title, that one could modify with xlabel property). I have the next piece of code: %% Some figure properties: width=15;height=20;alw=0.75; %% Figure: for i=1:8 figure;set

R Markdown HTML Number Figures

谁说我不能喝 提交于 2019-12-17 16:06:52
问题 Does anyone know how to number the figures in the captions, for HTML format R Markdown script? For PDF documents, the caption will say something like: Figure X: Some Caption Text However, the equivalent caption for the HTML version will simply say: Some Caption Text This makes cross-referencing figures by number completely useless. Here is a minimal example: --- title: "My Title" author: "Me" output: pdf_document: default html_document: default --- ```{r cars, fig.cap = "An amazing plot"}

Dynamic Legend (Updates in every recursion)

倖福魔咒の 提交于 2019-12-17 15:41:58
问题 I got a for i=1:15 . Inside I generate a variable d=1:0.01:10 , which is the x'x axis and based on this, I create a continuous function F(d) which has 2 unique variables pitch and yaw. I then plot this using different colors in every recursion using cmap = hsv(15); . So then it is: d=1:0.01:10; cmap = hsv(15); for i=1:15 pitch = unidrnd(10); yaw = unidrnd(10); for j=1:length(d) F(j) = d(j)*3*pitch*yaw; %// some long calculation here end p1 = plot(d,F,'Linewidth', 1.0); title ('blah blah') set

Matplotlib different size subplots

天涯浪子 提交于 2019-12-16 23:01:29
问题 I need to add two subplots to a figure. One subplot needs to be about three times as wide as the second (same height). I accomplished this using GridSpec and the colspan argument but I would like to do this using figure so I can save to PDF. I can adjust the first figure using the figsize argument in the constructor, but how do I change the size of the second plot? 回答1: Another way is to use the subplots function and pass the width ratio with gridspec_kw : import numpy as np import matplotlib