package montecarlo;

import ptolemy.plot.Plot;

/**
 * Simple presentation of a set of values on a line
 * Draws a vertical line on the x-axis corresponding to each point in the set.
 */
    
    public class DisplayValues extends Plot {
        
        int maxValues = 10000;
        
        public DisplayValues() {
            setTitle("Values");
            setYRange(0,0.1);
            setXRange(0, 1);
//            setPointsPersistence(300);
            setImpulses(true);
            setMarksStyle("none");
            setDoYTicks(false);
        }
        
        public int getMaxValues() {return maxValues;}
        public void setMaxValues(int max) {maxValues = max;}
        
        public void display(double[] x) {
            clear(false);
            repaint();
            int skip = Math.max(x.length/maxValues,1);
            for(int i=0; i<x.length; i+=skip) {addPoint(0,x[i],0.1,false);}
        }
            
        
    }  //end of DisplayValues
