Search Results

Search found 115 results on 5 pages for 'histogram'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • python histogram one-liner

    - by mykhal
    there are many ways, how to code histogram in Python. by histogram, i mean function, counting objects in an interable, resulting in the count table (i.e. dict). e.g.: >>> L = 'abracadabra' >>> histogram(L) {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r': 2} it can be written like this: def histogram(L): d = {} for x in L: if x in d: d[x] += 1 else: d[x] = 1 return d ..however, there are much less ways, how do this in a single expression. if we had "dict comprehensions" in python, we would write: >>> { x: L.count(x) for x in set(L) } but we don't have them, so we have to write: >>> dict([(x, L.count(x)) for x in set(L)]) however, this approach may yet be readable, but is not efficient - L is walked-through multiple times, so this won't work for single-life generators.. the function should iterate well also through gen(), where: def gen(): for x in L: yield x we can go with reduce (R.I.P.): >>> reduce(lambda d,x: dict(d, x=d.get(x,0)+1), L, {}) # wrong! oops, does not work, the key name is 'x', not x :( i ended with: >>> reduce(lambda d,x: dict(d.items() + [(x, d.get(x, 0)+1)]), L, {}) (in py3k, we would have to write list(d.items()) instead of d.items(), but it's hypothethical, since there is no reduce there) please beat me with a better one-liner, more readable! ;)

    Read the article

  • Histogram using gnuplot?

    - by mary
    I know how to create a histogram (just use "with boxes") in gnuplot if my .dat file already has properly binned data. Is there a way to take a list of numbers and have gnuplot provide a histogram based on ranges and bin sizes the user provides?

    Read the article

  • Microsoft Charting Histogram Zero With Line

    - by Brownman98
    I am currently developing an application that uses chart control to create a histogram. The histogram displays data correctly however I would like to center the data. Right now the Min and Max are automatically set. I would like the graph to always force its to be displayed symmetrically. Here is an example of what I'm trying to accomplish. Basically I would like it to look like a normal distribution graph. Does anyone know how I can do the the following: Get the graph to be displayed symmetrically? Always show a zero line. Here is the aspx markup. <asp:Chart ID="ChartHistogram" runat="server" Height="200" Width="300"> <Series> <asp:Series Name="SeriesDataHistogram" ChartType="RangeColumn" Color="#4d5b6e" BorderColor="#ffffff" BorderDashStyle="NotSet"> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartAreaMain" BorderColor="#CCCCCC"> <AxisX TitleFont="Arial, 7pt" LabelAutoFitMaxFontSize="7"> <MajorGrid LineColor="#FFFFFF" Interval="5" /> <LabelStyle Format="P1" /> </AxisX> <AxisY Title="Frequency" TitleFont="Arial, 7pt" LabelAutoFitMaxFontSize="7"> <MajorGrid LineColor="#FFFFFF" /> </AxisY> </asp:ChartArea> </ChartAreas> </asp:Chart> Here is the code behind private void DrawHistogram(List<ReturnDataObject> list) { foreach (ReturnDataObject r in list) this.ChartHistogram.Series["SeriesDataHistogram"].Points.AddY(r.ReturnAmount); // HistogramChartHelper is a helper class found in the samples Utilities folder. HistogramChartHelper histogramHelper = new HistogramChartHelper(); // Show the percent frequency on the right Y axis. histogramHelper.ShowPercentOnSecondaryYAxis = false; // Create histogram series histogramHelper.CreateHistogram(ChartHistogram, "SeriesDataHistogram", "Histogram"); } Thanks for any help.

    Read the article

  • Histogram equalisation of colour images with Java

    - by Tunji Gbadamosi
    I'm trying to histogram equalise a colour image with Java. At first I thought about applying the greyscale method to each RGB value, however, I've since learned that this would disrupt the colour distribution of the image. So, my question is: which is a better way to histogram equalise a colour image with Java?

    Read the article

  • Generate random number histogram using java

    - by Chewart
    Histogram -------------------------------------------------------- 1 ****(4) 2 ******(6) 3 ***********(11) 4 *****************(17) 5 **************************(26) 6 *************************(25) 7 *******(7) 8 ***(3) 9 (0) 10 *(1) -------------------------------------------------------- basically above is what my prgram needs to do.. im missing something somewhere any help would be great :) import java.util.Random; public class Histogram { /*This is a program to generate random number histogram between 1 and 100 and generate a table */ public static void main(String args[]) { int [] randarray = new int [80]; Random random = new Random(); System.out.println("Histogram"); System.out.println("---------"); int i ; for ( i = 0; i<randarray.length;i++) { int temp = random.nextInt(100); //random numbers up to number value 100 randarray[i] = temp; } int [] histo = new int [10]; for ( i = 0; i<10; i++) { /* %03d\t, this generates the random numbers to three decimal places so the numbers are generated with a full number or number with 00's or one 0*/ if (randarray[i] <= 10) { histo[i] = histo[i] + 1; //System.out.println("*"); } else if ( randarray[i] <= 20){ histo[i] = histo[i] + 1; } else if (randarray[i] <= 30){ histo[i] = histo[i] + 1; } else if ( randarray[i] <= 40){ histo[i] = histo[i] + 1; } else if (randarray[i] <= 50){ histo[i] = histo[i] + 1; } else if ( randarray[i] <=60){ histo[i] = histo[i] + 1; } else if ( randarray[i] <=70){ histo[i] = histo[i] + 1; } else if ( randarray[i] <=80){ histo[i] = histo[i] + 1; } else if ( randarray[i] <=90){ histo[i] = histo[i] + 1; } else if ( randarray[i] <=100){ histo[i] = histo[i] + 1; } switch (randarray[i]) { case 1: System.out.print("0-10 | "); break; case 2: System.out.print("11-20 | "); break; case 3: System.out.print("21-30 | "); break; case 4: System.out.print("31-40 | "); break; case 5: System.out.print("41-50 | "); break; case 6: System.out.print("51-60 | "); break; case 7: System.out.print("61-70 | "); break; case 8: System.out.print("71-80 | "); break; case 9: System.out.print("81-90 | "); break; case 10: System.out.print("91-100 | "); } for (int i = 0; i < 80; i++) { randomNumber = random.nextInt(100) index = (randomNumber - 1) / 2; histo[index]++; } } } }

    Read the article

  • CUDA: accumulate data into a large histogram of floats

    - by shoosh
    I'm trying to think of a way to implement the following algorithm using CUDA: Working on a large volume of voxels, for each voxel I calculate an index i and a value c. after the calculation I need to perform histogram[i] += c c is a float value and the histogram can have up to 15,000 bins. I'm looking for a way to implement this efficiently using CUDA. The first obvious problem is that with compute capabilities 1.3 which is what I'm using I can't even do an atomicAdd() of floats so how can I accumulate anything reliably? This example by nVidia does something somewhat simpler. The histograms are saved in the shared memory (which I can't do due to its size) and it only accumulates integers. Can this approach be generalized to my case?

    Read the article

  • how to make a CUDA Histogram kernel?

    - by kitw
    Hi all, I am writing a CUDA kernel for Histogram on a picture, but I had no idea how to return a array from the kernel, and the array will change when other thread read it. Any possible solution for it? __global__ void Hist( TColor *dst, //input image int imageW, int imageH, int*data ){ const int ix = blockDim.x * blockIdx.x + threadIdx.x; const int iy = blockDim.y * blockIdx.y + threadIdx.y; if(ix < imageW && iy < imageH) { int pixel = get_red(dst[imageW * (iy) + (ix)]); //this assign specific RED value of image to pixel data[pixel] ++; // ?? problem statement ... } } @para d_dst: input image TColor is equals to float4. @para data: the array for histogram size [255] extern "C" void cuda_Hist(TColor *d_dst, int imageW, int imageH,int* data) { dim3 threads(BLOCKDIM_X, BLOCKDIM_Y); dim3 grid(iDivUp(imageW, BLOCKDIM_X), iDivUp(imageH, BLOCKDIM_Y)); Hist<<<grid, threads>>>(d_dst, imageW, imageH, data); }

    Read the article

  • Histogram in Matplotlib with input file

    - by Arkapravo
    I wish to make a Histogram in Matplotlib from an input file containing the raw data (.txt). I am facing issues in referring to the input file. I guess it should be a rather small program. Any Matplotlib gurus, any help ? I am not asking for the code, some inputs should put me on the right way !

    Read the article

  • Local Histogram Equalization with Matlab

    - by Mertie Pertie
    hi all Histogram equalization is simple with histeq function but when it comes local hist. eq., im supposed to use a neighbourhood and move it along the image matrix and do it locally at each iteration. I wonder how I can implement it with Matlab, is it possible if i use histeq for each neighbourhood or is there any other predefined m-function for this operation.

    Read the article

  • GNUPLOT: 2d histogram from set of points.

    - by Arman
    Hello, I have a pairs of the points with their weights: #x y w 0.111342 0.478917 0.232487 0.398107 1.79559 0.221714 0.200731 2.58651 0.0776068 0.0967412 1.49904 0.0645355 6.17638 8.63101 0.715604 0.306128 3.10917 0.0984595 0.340707 3.19344 0.10669 7.18627 8.59859 0.835751 8.56 9.63894 0.888065 5.14272 6.86074 0.749587 0.747202 3.812 0.196013 8.71891 10.1355 0.860232 0.346714 1.45895 0.237647 5.21932 8.84491 0.590094 9.42138 12.2082 0.771725 0.215627 2.42317 0.0889856 How to plot nice 2d histogram image with color bar? I found nice density map description but I don't wont to go via python. I there way to use only gnuplot scripting? Kind Regards Arman.

    Read the article

  • Creating a Reporting Services Histogram Chart for Statistical Distribution Analysis

    Typically transactional data is quite detailed and analyzing an entire dataset on a graph is not feasible. Generally such data is analyzed using some form of aggregation or frequency distribution. One of the specialized charts generally used in Reporting Services for statistical distribution is Histogram Charts. In this tip we look at how Histogram Charts can be used for statistical distribution analysis and how to create and configure this type of chart in SSRS.

    Read the article

  • Histogram matching - image processing - c/c++

    - by Raj
    Hello I have two histograms. int Hist1[10] = {1,4,3,5,2,5,4,6,3,2}; int Hist1[10] = {1,4,3,15,12,15,4,6,3,2}; Hist1's distribution is of type multi-modal; Hist2's distribution is of type uni-modal with single prominent peak. My questions are Is there any way that i could determine the type of distribution programmatically? How to quantify whether these two histograms are similar/dissimilar? Thanks

    Read the article

  • python how to put data on y-axis when plotting histogram

    - by user3041107
    I don't quite understand how to control y - axis when using plt.hist plot in python. I read my .txt data file - it contains 10 columns with various data. If I want to plot distribution of strain on x axis I take column n.5. But what kind of value appears on y axis ??? Don't understand that. here is the code: import numpy import matplotlib.pyplot as plt from pylab import * from scipy.stats import norm import sys strain = [] infile = sys.argv[1] for line in infile: ret = numpy.loadtxt(infile) strain += list(ret[:,5]) fig = plt.figure() plt.hist(strain, bins = 20) plt.show() Thanks for help!

    Read the article

  • Compare images after canny edge detection in OpenCV (C++)

    - by typoknig
    Hi all, I am working on an OpenCV project and I need to compare some images after canny has been applied to both of them. Before the canny was applied I had the gray scale images populating a histogram and then I compared the histograms, but when canny is added to the images the histogram does not populate. I have read that a canny image can populate a histogram, but have not found a way to make it happen. I do not necessairly need to keep using the histograms, I just want to know the best way to compare two canny images. SSCCE below for you to chew on. I have poached and patched about 75% of this code from books and various sites on the internet, so props to those guys... // SLC (Histogram).cpp : Defines the entry point for the console application. #include "stdafx.h" #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h> #include <stdio.h> #include <sstream> #include <iostream> using namespace std; IplImage* image1= 0; IplImage* imgHistogram1 = 0; IplImage* gray1= 0; CvHistogram* hist1; int main(){ CvCapture* capture = cvCaptureFromCAM(0); if(!cvQueryFrame(capture)){ cout<<"Video capture failed, please check the camera."<<endl; } else{ cout<<"Video camera capture successful!"<<endl; }; CvSize sz = cvGetSize(cvQueryFrame(capture)); IplImage* image = cvCreateImage(sz, 8, 3); IplImage* imgHistogram = 0; IplImage* gray = 0; CvHistogram* hist; cvNamedWindow("Image Source",1); cvNamedWindow("gray", 1); cvNamedWindow("Histogram",1); cvNamedWindow("BG", 1); cvNamedWindow("FG", 1); cvNamedWindow("Canny",1); cvNamedWindow("Canny1", 1); image1 = cvLoadImage("image bin/use this image.jpg");// an image has to load here or the program will not run //size of the histogram -1D histogram int bins1 = 256; int hsize1[] = {bins1}; //max and min value of the histogram float max_value1 = 0, min_value1 = 0; //value and normalized value float value1; int normalized1; //ranges - grayscale 0 to 256 float xranges1[] = { 0, 256 }; float* ranges1[] = { xranges1 }; //create an 8 bit single channel image to hold a //grayscale version of the original picture gray1 = cvCreateImage( cvGetSize(image1), 8, 1 ); cvCvtColor( image1, gray1, CV_BGR2GRAY ); IplImage* canny1 = cvCreateImage(cvGetSize(gray1), 8, 1 ); cvCanny( gray1, canny1, 55, 175, 3 ); //Create 3 windows to show the results cvNamedWindow("original1",1); cvNamedWindow("gray1",1); cvNamedWindow("histogram1",1); //planes to obtain the histogram, in this case just one IplImage* planes1[] = { canny1 }; //get the histogram and some info about it hist1 = cvCreateHist( 1, hsize1, CV_HIST_ARRAY, ranges1,1); cvCalcHist( planes1, hist1, 0, NULL); cvGetMinMaxHistValue( hist1, &min_value1, &max_value1); printf("min: %f, max: %f\n", min_value1, max_value1); //create an 8 bits single channel image to hold the histogram //paint it white imgHistogram1 = cvCreateImage(cvSize(bins1, 50),8,1); cvRectangle(imgHistogram1, cvPoint(0,0), cvPoint(256,50), CV_RGB(255,255,255),-1); //draw the histogram :P for(int i=0; i < bins1; i++){ value1 = cvQueryHistValue_1D( hist1, i); normalized1 = cvRound(value1*50/max_value1); cvLine(imgHistogram1,cvPoint(i,50), cvPoint(i,50-normalized1), CV_RGB(0,0,0)); } //show the image results cvShowImage( "original1", image1 ); cvShowImage( "gray1", gray1 ); cvShowImage( "histogram1", imgHistogram1 ); cvShowImage( "Canny1", canny1); CvBGStatModel* bg_model = cvCreateFGDStatModel( image ); for(;;){ image = cvQueryFrame(capture); cvUpdateBGStatModel( image, bg_model ); //Size of the histogram -1D histogram int bins = 256; int hsize[] = {bins}; //Max and min value of the histogram float max_value = 0, min_value = 0; //Value and normalized value float value; int normalized; //Ranges - grayscale 0 to 256 float xranges[] = {0, 256}; float* ranges[] = {xranges}; //Create an 8 bit single channel image to hold a grayscale version of the original picture gray = cvCreateImage(cvGetSize(image), 8, 1); cvCvtColor(image, gray, CV_BGR2GRAY); IplImage* canny = cvCreateImage(cvGetSize(gray), 8, 1 ); cvCanny( gray, canny, 55, 175, 3 );//55, 175, 3 with direct light //Planes to obtain the histogram, in this case just one IplImage* planes[] = {canny}; //Get the histogram and some info about it hist = cvCreateHist(1, hsize, CV_HIST_ARRAY, ranges,1); cvCalcHist(planes, hist, 0, NULL); cvGetMinMaxHistValue(hist, &min_value, &max_value); //printf("Minimum Histogram Value: %f, Maximum Histogram Value: %f\n", min_value, max_value); //Create an 8 bits single channel image to hold the histogram and paint it white imgHistogram = cvCreateImage(cvSize(bins, 50),8,3); cvRectangle(imgHistogram, cvPoint(0,0), cvPoint(256,50), CV_RGB(255,255,255),-1); //Draw the histogram for(int i=0; i < bins; i++){ value = cvQueryHistValue_1D(hist, i); normalized = cvRound(value*50/max_value); cvLine(imgHistogram,cvPoint(i,50), cvPoint(i,50-normalized), CV_RGB(0,0,0)); } double correlation = cvCompareHist (hist1, hist, CV_COMP_CORREL); double chisquare = cvCompareHist (hist1, hist, CV_COMP_CHISQR); double intersection = cvCompareHist (hist1, hist, CV_COMP_INTERSECT); double bhattacharyya = cvCompareHist (hist1, hist, CV_COMP_BHATTACHARYYA); double difference = (1 - correlation) + chisquare + (1 - intersection) + bhattacharyya; printf("correlation: %f\n", correlation); printf("chi-square: %f\n", chisquare); printf("intersection: %f\n", intersection); printf("bhattacharyya: %f\n", bhattacharyya); printf("difference: %f\n", difference); cvShowImage("Image Source", image); cvShowImage("gray", gray); cvShowImage("Histogram", imgHistogram); cvShowImage( "Canny", canny); cvShowImage("BG", bg_model->background); cvShowImage("FG", bg_model->foreground); //Page 19 paragraph 3 of "Learning OpenCV" tells us why we DO NOT use "cvReleaseImage(&image)" in this section cvReleaseImage(&imgHistogram); cvReleaseImage(&gray); cvReleaseHist(&hist); cvReleaseImage(&canny); char c = cvWaitKey(10); //if ASCII key 27 (esc) is pressed then loop breaks if(c==27) break; } cvReleaseBGStatModel( &bg_model ); cvReleaseImage(&image); cvReleaseCapture(&capture); cvDestroyAllWindows(); }

    Read the article

  • Ho to make Histogram Normalize and Equalize in java using JAI library?

    - by Jay
    I m making App in java using Swing component and JAI library. I make histogram of black and white or gray scale image.Is this method of making histogram correct? iif it is correct then how can i do normalization and Equalization of histogram in my App in java using JAI library?my code is below. in my code i make BufferedImage object and then make and plot histogram of that image . enter code here import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import javax.media.jai.JAI; import javax.media.jai.PlanarImage; import javax.swing.*; public class FinalHistogram extends JPanel { static int[] bins = new int[256]; static int[] newBins = new int[256]; static int x1 = 0, y1 = 0; static PlanarImage image = JAI.create("fileload", "alp_finger.tiff"); static BufferedImage bi = image.getAsBufferedImage(); FinalHistogram(int[] pbins) { for (int i = 0; i < 256; i++) { bins[i] = pbins[i]; newBins[i] = 0; } repaint(); } @Override protected void paintComponent(Graphics g) { for (int i = 0; i < 256; i++) { g.drawLine(150 + i, 300, 150 + i, 300 - (bins[i] / 300)); if (i == 0 || i == 255) { String sr = new Integer((i)).toString(); g.drawString(sr, 150 + i, 305); } System.out.println("bin[" + i + "]===" + bins[i]); } } public static void main(String[] args) throws IOException { int[] sbins = new int[256]; int pixel = 0; int k = 0; for (int x = 0; x < bi.getWidth(); x++) { for (int y = 0; y < bi.getHeight(); y++) { pixel = bi.getRaster().getSample(x, y, 0); k = (int) (pixel / 256); sbins[k]++; //pixel = bi.getRGB(x, y) & 0x000000ff; //k=pixel; //int[] pixels = m_image.getRGB(0, 0, m_image.getWidth(), m_image.getHeight(), null, 0, m_image.getWidth()); //short currentValue = 0; //int red,green,blue; //for(int i = 0; i<pixels.length; i++){ //red = (pixels[i] >> 16) & 0x000000FF; //green = (pixels[i] >>8 ) & 0x000000FF; //blue = pixels[i] & 0x000000FF; //currentValue = (short)((red + green + blue) / 3); //Current value gives the average //Disregard the alpha //assert(currentValue >= 0 && currentValue <= 255); //Something is awfully wrong if this goes off... //m_histogramArray[currentValue] += 1; //Increment the specific value of the array //} } } JTabbedPane jtp = new JTabbedPane(); jtp.addTab("Histogram", new JScrollPane(new FinalHistogram(sbins))); JFrame frame = new JFrame(); frame.setSize(500, 500); frame.add(new JScrollPane(jtp)); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }

    Read the article

  • how to plot scatterplot and histogram using R [migrated]

    - by Wee Wang Wang
    I have a dataset about maximum wind speed(cm) as below: Year Jan Feb Mar Apr May June July Aug Sept Oct Nov Dec 2011 4.5 5.6 5.0 5.4 5.0 5.0 5.2 5.3 4.8 5.4 5.4 3.8 2010 4.6 5.0 5.8 5.0 5.2 4.5 4.4 4.3 4.9 5.2 5.2 4.6 2009 4.5 5.3 4.3 3.9 4.7 5.0 4.8 4.7 4.9 5.6 4.9 4.1 2008 3.8 1.9 5.6 4.7 4.7 4.3 5.9 4.9 4.9 5.6 5.2 4.4 2007 4.6 4.6 4.6 5.6 4.2 3.6 2.5 2.5 2.5 3.3 5.6 1.5 2006 4.3 4.8 5.0 5.2 4.7 4.6 3.2 3.4 3.6 3.9 5.9 4.4 2005 2.7 4.3 5.7 4.7 4.6 5.0 5.6 5.0 4.9 5.9 5.6 1.8 How to create monthly max wind speed scatterplot (month in x-axis and wind speed in y-axis) and also the monthly max wind speed histogram by using R programming?

    Read the article

  • Horizontal histogram won't accept input after the first input

    - by vincentbelkin
    So I'm making a program which is supposed to print a horizontal histogram of the lengths of words in its input. I don't know if most of it is OK since the main problem is it won't accept any input after the first one. Oh I also put comments on the parts I'm having some trouble with, like how to print "-" multiple times in order to represent histogram. I've tried making other versions of the code but I couldn't check if I'm close to getting it because again it won't accept another input after the first input. /*Write a program to print a histogram of the lengths of words in its input. It is easy to draw the histogram with the bars horizontal*/ #include <stdio.h> #define MAX 30 #define IN 1 #define OUT 0 int main() { int a,c,i,k,state,word[MAX]; a=0; k=0; state=OUT; for(i=0;i<MAX;i++) word[i]=0; while((c=getchar())!=EOF) { if(c==' '||c=='\t'||c=='\n') state=OUT; else state=IN; while(state==IN) a++; if(state==OUT) { word[i]=a; i++; } /*This part is hard for me, I don't know how to print X multiple times!*/ if((c==getchar())&&c==EOF) { for(i=0;i<MAX;i++) { for(i=0;i<=word[i];i++) putchar('-'); putchar('\n'); } } } }

    Read the article

  • How to draw histogram in Processing

    - by theolc
    I have an arrayList and I would like to take the size of the ten arrayList elements and use the sizes to create a histogram. I understand processing coordinate system starts in the top left corner. My question is, how do I use the arrayList.size() values to start at 450 (based from a 500,500 window) and go upwards from there to create my histogram. The following is my function for the histogram, it is receiving as a parameter the arrayList called bins. void histogram(ArrayList[] bins) { //set window background(0,0,0); size(500,500); background(255,255,255); line(50,0,50,500); line(0,450,500,450); int i; for (i = 50; i <= 500; i+=45) { line(i,450,i,480); } for (i = 50; i <= 450; i+=45) { line(50,i,20,i); } } Thanks in adavance for any help and input!

    Read the article

  • How do I draw an arrow on a histogram drawn using ggplot2?

    - by jon
    Here is dataset: set.seed(123) myd <- data.frame (class = rep(1:4, each = 100), yvar = rnorm(400, 50,30)) require(ggplot2) m <- ggplot(myd, aes(x = yvar)) p <- m + geom_histogram(colour = "grey40", fill = "grey40", binwidth = 10) + facet_wrap(~class) + theme_bw( ) p + opts(panel.margin=unit(0 ,"lines")) I want to add labels to bars which each subject class fall into and produce something like the post-powerpoint processed graph. Is there way to do this within R ? ...... Edit: we can think of different pointer such as dot or error bar, if arrow is not impossible Let's say the following is subjects to be labelled: class name yvar 2 subject4 104.0 3 subject3 8.5 3 subject1 80.0 4 subject2 40.0 4 subject1 115.0 classd <- data.frame (class = c(2,3,3,4,4), name = c ("subject4", "subject3", "subject1", "subject2", "subject1"), yvar = c(104.0, 8.5,80.0,40.0, 115.0))

    Read the article

  • What is a Histogram, and How Can I Use it to Improve My Photos?

    - by Eric Z Goodnight
    What’s with that weird graph with all the peaks and valleys? You’ve seen it when you open Photoshop or go to edit a camera raw file. But what is that weird thing called a histogram, and what does it mean? The histogram is one of the most important and powerful tools for the digital imagemaker. And with a few moments reading, you’ll understand a few simple rules can make you a much more powerful image editor, as well as helping you shoot better photographs in the first place. So what are you waiting for? Read on!  What is a Histogram, and How Can I Use it to Improve My Photos?How To Easily Access Your Home Network From Anywhere With DDNSHow To Recover After Your Email Password Is Compromised

    Read the article

  • Dynamically building and updating Histograms with JFreeChart

    - by job
    I've got a stream of incoming data that I would like to plot using a simple histogram. I don't know the range of values, or the proper resolution or bin width to use for the histogram. SimpleHistogramDataset provides some of this functionality, but I don't want to have to deal with catching exceptions in order to add new bins if the new value isn't covered. In addition, it doesn't easily allow me to rebuild the histogram using a different bin width (perhaps an integer multiples of some initial set width). Is there an easy way to accomplish this with JFreeChart or some alternate charting library, or am I going to have to write my own class here?

    Read the article

  • how to define fill colours in ggplot histogram?

    - by Andreas
    I have the following simple data data <- structure(list(status = c(9, 5, 9, 10, 11, 10, 8, 6, 6, 7, 10, 10, 7, 11, 11, 7, NA, 9, 11, 9, 10, 8, 9, 10, 7, 11, 9, 10, 9, 9, 8, 9, 11, 9, 11, 7, 8, 6, 11, 10, 9, 11, 11, 10, 11, 10, 9, 11, 7, 8, 8, 9, 4, 11, 11, 8, 7, 7, 11, 11, 11, 6, 7, 11, 6, 10, 10, 9, 10, 10, 8, 8, 10, 4, 8, 5, 8, 7), statusgruppe = c(0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, NA, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0)), .Names = c("status", "statusgruppe"), class = "data.frame", row.names = c(NA, -78L )) from that I'd like to make a histogram: ggplot(data, aes(status))+ geom_histogram(aes(y=..density..), binwidth=1, colour = "black", fill="white")+ theme_bw()+ scale_x_continuous("Staus", breaks=c(min(data$status,na.rm=T), median(data$status, na.rm=T), max(data$status, na.rm=T)),labels=c("Low", "Middle", "High"))+ scale_y_continuous("Percent", formatter="percent") Now - i'd like for the bins to take colou according to value - e.g. bins with value 9 gets dark grey - everything else should be light grey. I have tried with "fill=statusgruppe", scale_fill_grey(breaks=9) etc. - but I can't get it to work. Any ideas?

    Read the article

1 2 3 4 5  | Next Page >