in Education by
I am a gnuplot-newbie and am stuck with the following situation. Based on this I have a gnuplot script as follows: clear reset set key off set border 3 set style fill solid 1.0 noborder bin_width = 0.01; set boxwidth bin_width absolute bin_number(x) = floor(x/bin_width) rounded(x) = bin_width * ( bin_number(x) + 0.5 ) plot '1000randomValuesBetween0and1.dat' using (rounded($1)):(1) smooth frequency Which was a good first step; but I would like to have a smooth curve through the points that are generated by counting the frequency. with filledcurves lacked what I wanted in 2 ways. First it is not smoothed (I would prefer something like bezier which is not usable after with); second the filling is done in a rather unexpected way which doesn't fit my needs (for me unexpected). See this picture . To give a little bit more context: I ultimately want to use this to generate violin plots with gnuplot without having to do the binning beforehand so I can just give my script a single-column data-file and am ready to go. EDIT: I tried adapting the "normal" density plot from this demo as another first step, but I failed; I read in the documentation that bandwidth should be 1/#points so it should be 0.001 in my case meaning I tried this: set border 3 front lt black linewidth 1.000 dashtype solid set style increment default set style data filledcurves set xtics border in scale 0,0 nomirror norotate autojustify set xtics norangelimit 0.00000,0.5,1.0 set title "Same data - kernel density" set title font ",15" norotate plot 'random01.dat' using 1:(1) smooth kdensity bandwidth 0.001 with filledcurves above y lt 9 which results in this picture:. Setting no bandwith or lower/higher values didn't solve the issue. The plot specifies using 1:(1) because I just have a single column so according to the doc the first value should be this column and as the second value would specify a weighting which should be 1/#points according to doc. EDIT2: Setting bandwidth to the ideal value or not setting it at all always yields the same result which doesn't change anything except the scale of the y-axis with changing the weighting. My data are 1000 values in a range between 0 and 1 (created randomly for testing purposes). Here the new plot EDIT3: zooming out may show another aspect of the problem as the plot seems to extend outside the interval of the given values (I checked the values and there are no examples <0 or >1). Here's the graph: JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The demo 'violinplot.dem' included with the gnuplot distribution package and also available online shows how to do what you want using the combination "smooth kdensity" and "with filledcurve" applied to unbinned data. Online version here: violin plot demo Notes: You mis-read the documentation. 1/N is not the recommended bandwidth, it is the normalized uniform weight. The plot you showed initially looks like the bandwidth was set far too low. What is the range of values in your data? I suggest letting the program calculate the "ideal" bandwidth for you and then adjusting it afterwards if you think it is too large. The ideal value is stored in GPVAL_KDENSITY_BANDWIDTH. Increasing the bandwidth will make the envelope smoother; decreasing it will emphasize local spikes.

Related questions

0 votes
    I've got a data file of the form: Series_1 "12-Dec-2011 12:00" 32 Series_1 "12-Dec-2011 12 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    The total area under the complete curve divided by the distance of the curve is called? (a) peak to peak value ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 19, 2021 in Education by JackTerrance
0 votes
    I store all of the Google Maps marker objects in a single array. Right now I am trying to set up ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    This code represents the plot of the function g with two horizontal lines and one vertical line: function y = g(x) if x < 5 | 50 < x then error("Out of range"); elseif x...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    How can I ask the user to enter a value during the execution of a GnuPlot script? I would like ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I'm reading data from a csv file in help of gnuplot. Most of the lines have 8 columns, some of ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    I hope my question isn't always the same question. I have a QGraphicsScene. Its items are some ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 20, 2022 in Education by JackTerrance
0 votes
    ______ display a smooth density estimate. (a) geom_density2 (b) geom_density (c) aes_sdensity (d) geom_contour I ... of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    (e) Which of the following is the mode for Pencil tool? (i) Smooth (ii) Straighten (iii) Both (a) and (b) (iv) Curve Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
0 votes
    Star Ltd has received application for 48 crore (issue size was50crore ) discuss the document filled with a register of companies Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
...