histogram

adding error bar to histogram in gnuplot

天涯浪子 提交于 2019-12-05 09:59:07
I have data file which looks like this #col 1 2 3 4 5 6 7 #bench #these are max and min values #mark #bar1 #bar2 #for the prevoius 2 values NOSHARE.2 43032 139412 100 45000 130000 140000 FALSE_SHARE.2 7035 24101 5000 7500 24100 25000 SHAREDVAR.2 11316 10248 10000 12000 10000 12000 I am able to generate a graph using gnuplot which looks like this I need to add max and min value as an error bar to each bar Heres my gnuplot script set output "truevsfalse.png" set title " TRUE VS FALSE SHARING " set boxwidth 0.9 absolute set style fill solid 1.00 border lt -1 set key inside right top vertical

I need ggplot scale_x_log10() to give me both negative and positive numbers as output

回眸只為那壹抹淺笑 提交于 2019-12-05 06:50:37
问题 I generate a fine histogram here with both positive and negative numbers. x <- rnorm(5000,0,1000) library(ggplot2) df <- data.frame(x) ggplot(df, aes(x = x)) + geom_histogram() What I want is to have a logged x-axis. When I do this for only positive numbers with scale_x_log10(), it works like a charm. But here it does not and it either removes my negative numbers are adds them to the positive numbers. ggplot(df, aes(x = x)) + geom_histogram() + scale_x_log10() All I really want is for the

ggplot2 histogram legend too large

僤鯓⒐⒋嵵緔 提交于 2019-12-05 06:24:30
问题 I'm pretty happy with the results I'm getting with R. Most of my stacked histogram plots are looking fine, e.g. and However, I have a few that have so many categories in the legend that the legend is crowing out the plot, e.g. How can I fix this? Here is my plot.r, which I call on the command line like this RScript plot.r foo.dat foo.png 1600 800 foo.dat account,operation,call_count,day cal3510,foo-method,1,2016-10-01 cra4617,foo-method,1,2016-10-03 cus4404,foo-method,1,2016-10-03 hin4510,foo

ggplot2: Reading maximum bar height from plot object containing geom_histogram

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 05:53:07
Like this previous poster , I am also using geom_text to annotate plots in gglot2. And I want to position those annotations in relative coordinates (proportion of facet H & W) rather than data coordinates. Easy enough for most plots, but in my case I'm dealing with histograms. I'm sure the relevant information as to the y scale must be lurking in the plot object somewhere (after adding geom_histogram ), but I don't see where. My question: How do I read maximum bar height from a faceted ggplot2 object containing geom_histogram ? Can anyone help? Try this: library(plyr) library(scales) p <-

How to add colorbar to a histogram?

一个人想着一个人 提交于 2019-12-05 04:32:20
问题 I have a histogram like this (just like a normal histogram): In my situation, there are 20 bars always (spanning x axis from 0 to 1) and the color of the bar is defined based on the value on the x axis. What I want is to add a color spectrum like one of those in http://wiki.scipy.org/Cookbook/Matplotlib/Show_colormaps at the bottom of the histogram but I don't know how to add it. Any help would be appreciated! 回答1: You need to specify the color of the faces from some form of colormap, for

Vertical Histogram in Python and Matplotlib

江枫思渺然 提交于 2019-12-05 02:49:08
How can I make a vertical histogram. Is there any option for that or should it be built from the scratch? What I want is the upper graph to look like the below one but on vertical axis! from matplotlib import pyplot as plt import numpy as np sample=np.random.normal(size=10000) vert_hist=np.histogram(sample,bins=30) ax1=plt.subplot(2,1,1) ax1.plot(vert_hist[0],vert_hist[1][:-1],'*g') ax2=plt.subplot(2,1,2) ax2.hist(sample,bins=30) plt.show() mwaskom Use orientation="horizontal" in ax.hist : from matplotlib import pyplot as plt import numpy as np sample = np.random.normal(size=10000) vert_hist =

histogram without vertical lines in Mathematica

旧城冷巷雨未停 提交于 2019-12-05 02:14:25
I am trying to make an histogram without vertical lines. I'd like to have a plot which looks like a function. Like this: The same question has been asked for R before ( histogram without vertical lines ) but I'm on Mathematica. I have been looking into the ChartStyle options without success. There probably are ways to do this by fiddling with EdgeForm[] and FaceForm[] in Histogram , but I've found it simpler to roll one on my own, whenever I need it. Here's a very simple and quick example: histPlot[data_, bins_, color_: Blue] := Module[{ countBorder = Partition[Riffle[Riffle[#1, #1[[2 ;;]]],

How to generate Image Histogram in Android?

◇◆丶佛笑我妖孽 提交于 2019-12-05 01:01:54
问题 I tried to generate histogram of Image using following code, package com.example.viewfinderee368; import java.nio.ByteBuffer; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RectF; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.view.View; import

Creating a Python Histogram without Pylab

穿精又带淫゛_ 提交于 2019-12-04 22:26:02
I have to generate a list of random numbers with a gaussian distribution (I'm able to do this) and then take those numbers and plot them in a histogram. My problem is that I'm supposed to do this without using the built-in histogram function within pylab (or any other package for that matter) and I'm at a complete loss. I've been looking on-line and I haven't found anything that explains how I would go about this, does any of you know what I could do? Thanks in advance. Let's assume you have a numpy array that represents your random numbers rnd_numb=array([ 0.48942231, 0.48536864, 0.48614467,

Detect spots empty parking OPENCV

时光毁灭记忆、已成空白 提交于 2019-12-04 22:09:14
I want to apply a detector algorithm to detect empty areas of parking and I have read about SIFT and SURF, but I can't quite understand it. I have seen examples of comparison between two images, but that's not what I want. Could you explain about how to use SURF or SIFT on the issue of detecting empty spots on parking? I have also read about color histogram, can I have some documentation about it? I am working with OpenCV python 2.4.9 and 2.7 cyriel It depends on what you exactly want to achieve - if just want to find an empty spot and your camera higher than parking, it's quite possible that