我在R中绘制了截断的密度。这是dput
输出中我的多边形的坐标:
dat <- structure(list(pro.d.x = c(0.587084148727984, 0.589041095890411,
0.590998043052838, 0.592954990215264, 0.594911937377691, 0.596868884540117,
0.598825831702544, 0.600782778864971, 0.602739726027397, 0.604696673189824,
0.60665362035225, 0.608610567514677, 0.610567514677104, 0.61252446183953,
0.614481409001957, 0.616438356164384, 0.61839530332681, 0.620352250489237,
0.622309197651663, 0.62426614481409, 0.626223091976517, 0.628180039138943,
0.63013698630137, 0.632093933463796, 0.634050880626223, 0.63600782778865,
0.637964774951076, 0.639921722113503, 0.64187866927593, 0.643835616438356,
0.645792563600783, 0.647749510763209, 0.649706457925636, 0.651663405088063,
0.653620352250489, 0.655577299412916, 0.657534246575342, 0.659491193737769,
0.661448140900196, 0.663405088062622, 0.665362035225049, 0.667318982387475,
0.669275929549902, 0.671232876712329, 0.673189823874755, 0.675146771037182,
0.677103718199609, 0.679060665362035, 0.681017612524462, 0.682974559686888,
0.684931506849315, 0.686888454011742, 0.688845401174168, 0.690802348336595,
0.692759295499021, 0.694716242661448, 0.696673189823875, 0.698630136986301,
0.700587084148728, 0.702544031311155, 0.704500978473581, 0.706457925636008,
0.708414872798434, 0.710371819960861, 0.712328767123288, 0.714285714285714,
0.716242661448141, 0.718199608610568, 0.720156555772994, 0.722113502935421,
0.724070450097847, 0.726027397260274, 0.727984344422701, 0.729941291585127,
0.731898238747554, 0.73385518590998, 0.735812133072407, 0.737769080234834,
0.73972602739726, 0.741682974559687, 0.743639921722113, 0.74559686888454,
0.747553816046967, 0.749510763209393, 0.75146771037182, 0.753424657534246,
0.755381604696673, 0.7573385518591, 0.759295499021526, 0.761252446183953,
0.76320939334638, 0.765166340508806, 0.767123287671233, 0.769080234833659,
0.771037181996086, 0.772994129158513, 0.774951076320939, 0.776908023483366,
0.778864970645793, 0.780821917808219, 0.782778864970646, 0.784735812133072,
0.786692759295499, 0.788649706457926, 0.790606653620352, 0.792563600782779,
0.794520547945205, 0.796477495107632, 0.798434442270059, 0.800391389432485,
0.802348336594912, 0.804305283757339, 0.806262230919765, 0.808219178082192,
0.810176125244618, 0.812133072407045, 0.814090019569472, 0.816046966731898,
0.818003913894325, 0.819960861056751, 0.821917808219178, 0.823874755381605,
0.825831702544031, 0.827788649706458, 0.829745596868884, 0.831702544031311,
0.833659491193738, 0.835616438356164, 0.837573385518591, 0.839530332681018,
0.841487279843444, 0.843444227005871, 0.845401174168297, 0.847358121330724,
0.849315068493151, 0.851272015655577, 0.853228962818004, 0.85518590998043,
0.857142857142857, 0.859099804305284, 0.86105675146771, 0.863013698630137,
0.864970645792564, 0.86692759295499, 0.868884540117417, 0.870841487279843,
0.87279843444227, 0.874755381604697, 0.876712328767123, 0.87866927592955,
0.880626223091976, 0.882583170254403, 0.88454011741683, 0.886497064579256,
0.888454011741683, 0.89041095890411, 0.892367906066536, 0.894324853228963,
0.896281800391389, 0.898238747553816, 0.900195694716243, 0.902152641878669,
0.904109589041096, 0.906066536203523, 0.908023483365949, 0.909980430528376,
0.911937377690802, 0.913894324853229, 0.915851272015656, 0.917808219178082,
0.919765166340509, 0.921722113502935, 0.923679060665362, 0.925636007827789,
0.927592954990215, 0.929549902152642, 0.931506849315068, 0.933463796477495,
0.935420743639922, 0.937377690802348, 0.939334637964775, 0.941291585127201,
0.943248532289628, 0.945205479452055, 0.947162426614481, 0.949119373776908,
0.951076320939335, 0.953033268101761, 0.954990215264188, 0.956947162426614,
0.958904109589041, 0.960861056751468, 0.962818003913894, 0.964774951076321,
0.966731898238748, 0.968688845401174, 0.970645792563601, 0.972602739726027,
0.974559686888454, 0.976516634050881, 0.978473581213307, 0.980430528375734,
0.98238747553816, 0.984344422700587, 0.986301369863014, 0.98825831702544,
0.990215264187867, 0.992172211350294, 0.99412915851272, 0.996086105675147,
0.998043052837573, 1), pro.d.y = c(0, 0.0124763366981593, 0.0141124551851867,
0.0159018210787856, 0.0178518210828018, 0.0199740509194942, 0.0223445527492011,
0.0249064839074225, 0.0276662964727761, 0.0306302708705622, 0.0338545211312297,
0.0373385397435565, 0.0410496060511471, 0.0449918664776745, 0.0491758970805405,
0.0536901895276933, 0.0584490455650341, 0.0634544237153568, 0.0687081431462095,
0.0742700062159316, 0.0801277089300282, 0.086240025634052, 0.0926086975186578,
0.0992440060892446, 0.106239285811027, 0.113504059066459, 0.121044019265177,
0.128865573418761, 0.137048548852888, 0.145593863797181, 0.154467617291928,
0.163685889084493, 0.173280379056521, 0.183418988934254, 0.193997374886688,
0.205045023363949, 0.21659280832808, 0.228818951343029, 0.241754902638203,
0.255354359835895, 0.269660574110284, 0.284751550765693, 0.300974352004478,
0.318105788417593, 0.336193761251992, 0.355285850148719, 0.37570768608243,
0.397453045785548, 0.420391899838677, 0.444560692193431, 0.470052830600742,
0.497323432291453, 0.525934510701712, 0.55589495930279, 0.587210052668763,
0.620209479614381, 0.654737312164808, 0.690555064040503, 0.727627117977952,
0.765968447827405, 0.805823333992903, 0.846691934407899, 0.888496561425915,
0.931155864506105, 0.974725912749141, 1.01894272802093, 1.06358946338081,
1.10855652184076, 1.15373258418124, 1.19891666804584, 1.24392280480721,
1.28863577510934, 1.33294134574882, 1.37653543493332, 1.41927889838227,
1.46115790850083, 1.50208011643625, 1.54188812802516, 1.58010796114519,
1.61704327373793, 1.65264078703095, 1.68685158559086, 1.71924489000963,
1.74994440160701, 1.77914340182238, 1.80683605037902, 1.8329284799749,
1.85702633860664, 1.87966618832539, 1.90087561596266, 1.92068458372179,
1.93878680429694, 1.95543121172768, 1.97084637077113, 1.98507694736024,
1.99809848497021, 2.00970880002476, 2.0203323177052, 2.03001268341046,
2.03879277291169, 2.04650577512196, 2.05333770822687, 2.05943314402644,
2.06482425018454, 2.06949798196726, 2.07333994584229, 2.07659348278548,
2.07927970501823, 2.08141886898654, 2.08289568306932, 2.0838167309169,
2.08426362597097, 2.08425136563913, 2.08376347737203, 2.08272129413889,
2.0812848925494, 2.07947064189011, 2.07729538738197, 2.07469292214384,
2.07175241370009, 2.06853824861803, 2.06507440050244, 2.06137194834198,
2.05743920123393, 2.05338026815633, 2.04922923154637, 2.04502128439529,
2.04081183457356, 2.03667849489226, 2.03266717082546, 2.02882485726764,
2.02522571223853, 2.02203770460098, 2.0192476674025, 2.01691496522578,
2.01510017656093, 2.01407190394343, 2.01385052206395, 2.01443658686903,
2.01590202326501, 2.01841515958639, 2.02236038715918, 2.02751514911719,
2.03395909497369, 2.0417722975773, 2.0515066820042, 2.06304583606758,
2.07630508949246, 2.09136419448661, 2.1084876952701, 2.12825404999518,
2.15014999861247, 2.17424485778335, 2.2006062832039, 2.23002312279098,
2.26215697251894, 2.2968041549068, 2.33400970407032, 2.37407124084828,
2.41760250489697, 2.4638260220103, 2.51275499122616, 2.56439904161634,
2.61956960340193, 2.67771334572469, 2.73852719993077, 2.80198177705806,
2.86829607508334, 2.93788571360972, 3.00990094479677, 3.08426858458271,
3.16091081580917, 3.24034038243829, 3.3219275671303, 3.40533998955121,
3.49044957580254, 3.57725694079797, 3.66572547223431, 3.75521994794363,
3.84555419923005, 3.93653584878367, 4.02795152621416, 4.11931406838431,
4.21034136592417, 4.30077594829744, 4.39020281325105, 4.47783699125228,
4.56363022834507, 4.64726414556742, 4.72841524545307, 4.80564182077226,
4.87897706777627, 4.94833350100604, 5.01335537401227, 5.07307996209023,
5.1259118810479, 5.17287726780172, 5.21364011252759, 5.24787000019841,
5.27287709283815, 5.28975954430921, 5.29886896386876, 5.29997375028775,
5.29185426024869, 5.27278869421654, 5.24503234244234, 5.20852067701082,
5.16320857873499, 5.10629616085988, 5.04001017913819, 4.96520581342729,
4.88204743797809)), .Names = c("pro.d.x", "pro.d.y"), row.names = 301:512, class = "data.frame")
通常,我可以像这样使用plot()
和polygon()
对多边形区域进行相当容易的着色:
plot(dat,xlim = c(0,1), ylim = c(0,10), bty = 'n', xlab = NA, ylab = NA, main = NA, yaxs='i', xaxs = 'i', las = 1, cex = 0)
polygon(dat, col = 'green')