figure

Indicating the statistically significant difference in bar graph

梦想与她 提交于 2019-11-28 04:46:21
I use a bar graph to indicate the data of each group. Some of these bars differ significantly from each other. How can I indicate the significant difference in the bar plot? import numpy as np import matplotlib.pyplot as plt menMeans = (5, 15, 30, 40) menStd = (2, 3, 4, 5) ind = np.arange(4) # the x locations for the groups width=0.35 p1 = plt.bar(ind, menMeans, width=width, color='r', yerr=menStd) plt.xticks(ind+width/2., ('A', 'B', 'C', 'D') ) I am aiming for Hooked I've done a couple of things here that I suggest when working with complex plots. Pull out the custom formatting into a

Second subplot disappearing

荒凉一梦 提交于 2019-11-28 03:52:13
问题 I have a weird (and probably simple to solve) problem. I tried to plot (using panel) two plots: a1 = subplot(2,1,1, 'Parent', handles.cpd_plot, 'Position', [0.1, 0.4, 0.85, 0.45]); a2 = subplot(2,1,2, 'Parent', handles.cpd_plot, 'Position', [0.1, 0.1, 0.85, 0.15]); but after plotting a2, a1 disappears. I see that its some problem with position, when I lift up a1 a bit ( 'Position', [0.1, 0.5, 0.85, 0.45] ) its working (but it has to be >= 0.5). Where is the problem? Thanks! 回答1: So it is

R Markdown HTML Number Figures

孤者浪人 提交于 2019-11-27 21:25:40
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"} plot(cars) ``` ```{r cars2, fig.cap = "Another amazing plot"} plot(cars) ``` I have tried setting toc ,

Dynamic Legend (Updates in every recursion)

点点圈 提交于 2019-11-27 19:32:52
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(p1, 'Color', cmap(i,:)); hold on; legend (['pitch,yaw:', num2str(pitch) num2str(yaw)]) end hold off;

How to import local image using knitr for markdown

余生长醉 提交于 2019-11-27 19:17:07
I have an externally created png image in a local directory that I'd like to import to a report using knitr. The ultimate target filetype is html. I have no trouble getting my own figures to appear when I create them with R code, but I'm at a loss what I would have thought was a simpler problem. While I'm at it, how would I import a figure for which I have a url? If you already have a local image, you can just use the HTML or markdown syntax to include it in your document. HTML syntax is <img src="path/to/your/image" /> and markdown is ![title](path/to/your/image) . 来源: https://stackoverflow

How do I make a reference to a figure in markdown using pandoc?

℡╲_俬逩灬. 提交于 2019-11-27 19:13:28
问题 I'm currently writing a document in markdown and I'd like to make a reference to an image from my text. this is my text, I want a reference to my image1 [here]. blablabla ![image1](img/image1.png) I want to do that reference because after converting my markdown to pdf, images get placed in one or two pages after and the document doesn't make any sense. UPDATE: I've tried Ryan's answer in that post and I can't make it working. Apparently the code : [image]: image.png "Image Title" ![Alt text]

Matlab: How to obtain all the axes handles in a figure handle?

ぃ、小莉子 提交于 2019-11-27 18:44:36
How do I obtain all the axes handles in a figure handle? Given the figure handle hf , I found that get(hf, 'children') may return the handles of all axes. However, the Matlab Help suggests that it may return more than just the axes handles: Children of the figure . A vector containing the handles of all axes, user-interface objects displayed within the figure. You can change the order of the handles and thereby change the stacking of the objects on the display. Is there any way to obtain only the axes handle in the figure handle? Or how do I know if the handle returned by get(hf, 'children')

How do I tell Matplotlib to create a second (new) plot, then later plot on the old one?

懵懂的女人 提交于 2019-11-27 16:51:08
I want to plot data, then create a new figure and plot data2, and finally come back to the original plot and plot data3, kinda like this: import numpy as np import matplotlib as plt x = arange(5) y = np.exp(5) plt.figure() plt.plot(x, y) z = np.sin(x) plt.figure() plt.plot(x, z) w = np.cos(x) plt.figure("""first figure""") # Here's the part I need plt.plot(x, w) FYI How do I tell matplotlib that I am done with a plot? does something similar, but not quite! It doesn't let me get access to that original plot. If you find yourself doing things like this regularly it may be worth investigating the

Problem with float and pictures in LaTex

六眼飞鱼酱① 提交于 2019-11-27 15:36:10
问题 The picture is at the position of the header: http://dl.getdropbox.com/u/175564/%20latex1.png Code: \begin{figure} \subfloat[A gull]{\label{fig:gull}\includegraphics[width=0.15\textwidth]{p1.png}} \subfloat[A tiger]{\label{fig:tiger}\includegraphics[width=0.15\textwidth]{p2.png}} \caption{Pictures of animals} \label{fig:animals} \end{figure} Code before \begin{document}: \documentclass[12pt,a4paper, notitlepage]{article} \usepackage[english]{babel} \usepackage[latin1]{inputenc} \usepackage

Plot Overlay MATLAB

别来无恙 提交于 2019-11-27 13:04:53
问题 How do you take one plot and place it in the corner (or anywhere for that matter) of another plot in MATLAB? I have logarithmic data that has a large white space in the upper right-hand side of the plot. In the white space I would like to overlay a smaller plot containing a zoomed in version of the log plot in that white space (sort of like a magnified view). Before you tell me it can't be done, I would like to mention that I have seen it in action. If my description is lacking, just let me