histogram

x must be numeric while trying to create histogram in R

ぐ巨炮叔叔 提交于 2019-12-10 20:35:11
问题 I am a newbie in R. I need to generate some graphs. I imported an excel file and need to create a histogram on one column. My importing code is- file=read.xlsx('femalecommentcount.xlsx',1,header=FALSE) col=file[2] col looks like this (part) - 36961 1 36962 1 36963 7 36964 1 36965 2 36966 1 36967 1 36968 4 36969 1 36970 6 36971 3 36972 1 36973 6 36974 6 36975 2 36976 2 36977 8 36978 2 36979 1 36980 1 36981 1 the first column is the row number. I'm not sure how to remove this. The second column

Understanding histogram() in Pillow

≡放荡痞女 提交于 2019-12-10 19:24:00
问题 From the docs: im.histogram() => list Returns a histogram for the image. The histogram is returned as a list of pixel counts, one for each pixel value in the source image. If the image has more than one band, the histograms for all bands are concatenated (for example, the histogram for an “RGB” image contains 768 values). I understand that there are 256 values for Red, 256 for Green and 256 for Blue (256 * 3 = 768). for i, value in enumerate(im.histogram()): print i, value Produces: 0 329 1

How to obtain the RGB colors of the camera texture in OpenGL ES 2.0 for Android in Java

半腔热情 提交于 2019-12-10 18:35:10
问题 I'm trying to port a .NET app to Android where I capture each frame from the camera and then modify it accordingly to user settings before displaying it. Doing it in .NET was simple since I was able to simply query the camera for the next image and I would get a bitmap that I could access at will. One of the many processing options requires the application to obtain the intensity histogram of each captured image and then do some modifications to the captured image before displaying the result

GNUPLOT: Trying to increase the quality

假装没事ソ 提交于 2019-12-10 18:33:28
问题 How do I increase the quality in gnuplot? It seems like it's a very low-res image. Here's the contents of the file i'm using: linkage.plot set terminal pdf set out 'linkage.pdf' set title "Distribution of Scores" set xlabel "Score Value" set ylabel "Appearences" set yrange [0:50000] set xrange [0:70] binwidth=.25 bin(x,width)=width*floor(x/width) plot 'linkage.dat' using (bin($1,binwidth)):(1.0) title "Scores"\ smooth freq with boxes 回答1: gnuplot pdf output is usually pretty good (it's

How to plot a hanging rootogram in python?

空扰寡人 提交于 2019-12-10 18:26:41
问题 Inspired by this question, how do you make the same kind of plot in python? This plot aims at having a nice visual representation of how your distribution is off of the expected distribution. It hangs the bars of your histogram to the expected distribution line, so the difference to the expected value is read between the bottom of the bar and the x-axis, instead of between the top of the bar and the expected distribution curve. I could not find any built in function. 回答1: The idea is to just

Plot aligned x,y 1d histograms from projected 2d histogram

扶醉桌前 提交于 2019-12-10 18:24:52
问题 I need to generate an image similar to the one shown in this example: The difference is that, instead of having the scattered points in two dimensions, I have a two-dimensional histogram generated with numpy's histogram2d and plotted using with imshow and gridspec : How can I project this 2D histogram into a horizontal and a vertical histogram (or curves) so that it looks aligned, like the first image? import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec

Error in hist.default(xa) : 'x' must be numeric

眉间皱痕 提交于 2019-12-10 18:20:58
问题 I'm a complete R beginner, and am trying to do something pretty basic - make histograms of two vectors I imported from Excel. The vectors are xa and xb. I tried hist(xa), and get the following error: Error in hist.default(xa) : 'x' must be numeric So I did some searching, and tried to remedy this using as.numeric(xa), and got: Error: (list) object cannot be coerced to type 'double' So I tried the as.list function, but it turned my vector into a matrix. Not really sure what's going on. The

R histogram range error: some 'x' not counted; maybe 'breaks' do not span range of 'x

拜拜、爱过 提交于 2019-12-10 18:09:46
问题 I have a dataset that I'd like to plot with hist in R. There are a number of rows in the dataset whose values are beyond a value that I care about. Specifically, my R script is: library(ggplot2) data = read.table("input.txt", sep=" ", strip.white=TRUE, header=TRUE) pdf("out.pdf") hist(data$actions,breaks=seq(0,130,by=1)) dev.off() An example dataset for input.txt is: name actions foo 3 bar 129 baz 131 If I run the R script, I get an error: Error in hist.default(data$actions, breaks = seq(0,

numpy beginner: writing an array using numpy.savetxt

我们两清 提交于 2019-12-10 17:54:28
问题 I have a numpy histogram that I would like to output as a tab-delimited text file. My code is below: targethist = np.histogram(targetlist, bins=ilist) print targethist np.savetxt('ChrI_dens.txt',targethist,delimiter='\t') targetlist and ilist are long lists of integers. I get the following output: (array([0, 0, 0, ..., 0, 0, 0]), array([ 1, 10000, 20000, ..., 15060000, 15070000, 15072422])) Traceback (most recent call last): File "target_dens_np.py", line 62, in np.savetxt('ChrI_dens.txt'

jfreechart histogram with dates

半城伤御伤魂 提交于 2019-12-10 17:48:04
问题 I want to display some dates in the X axis of a histogram chart, but i don't understand how i can do it with this code i can create a simple histogram with couples of x-y values, but they can olny be numbers, not date: DefaultTableXYDataset dataset = new DefaultTableXYDataset(); XYSeries serie = new XYSeries("Andamento consumi", true, false); serie.add(30, 8.3); serie.add(31, 7.1); serie.add(1, 8.7); serie.add(2, 6.0); serie.add(3, 11.9); dataset.addSeries(serie); JFreeChart chart =