Skip to main content

plotting - Smoothing a cusp in plotted data


Here are my data points:


59.51 -59.3642
58.9944 -58.8079
58.4836 -58.2471
57.9778 -57.6819
57.4769 -57.1122
56.981 -56.5383
56.4901 -55.96
56.0043 -55.3775

55.5236 -54.7907
55.048 -54.1998
54.5777 -53.6048
54.1125 -53.0056
53.6525 -52.4025
53.1979 -51.7953
52.7486 -51.1842
52.3046 -50.5692
51.866 -49.9503
51.4328 -49.3277

51.0051 -48.7013
50.5828 -48.0712
50.4206 -47.8259
50.0013 -48.2641
49.5782 -48.6986
49.1514 -49.1294
48.7208 -49.5564
48.2865 -49.9797
47.8485 -50.3992
47.4069 -50.8148

46.9616 -51.2266
46.5128 -51.6344
46.0604 -52.0384
45.6046 -52.4383
45.1452 -52.8343
44.6824 -53.2263
44.2163 -53.6141
43.7467 -53.998
43.2738 -54.3777
42.7977 -54.7532

42.3182 -55.1246
41.8356 -55.4918
41.3497 -55.8548
40.8607 -56.2135
40.3686 -56.5679
39.8734 -56.918
39.3752 -57.2638
38.874 -57.6053
38.3698 -57.9423
37.8627 -58.2749

37.3528 -58.6031
36.8399 -58.9269
36.3243 -59.2461
35.8059 -59.5608
35.2848 -59.871
34.761 -60.1767
34.2345 -60.4777
33.7055 -60.7741
33.1738 -61.066
32.6397 -61.3531

32.103 -61.6356
31.5639 -61.9134
31.0224 -62.1865
30.4786 -62.4549
29.9324 -62.7185
29.384 -62.9773
28.8333 -63.2313
28.2804 -63.4805
27.7253 -63.7249
27.1682 -63.9644

26.609 -64.1991
26.0477 -64.4288
25.4845 -64.6537
24.9193 -64.8736
24.3522 -65.0886
23.7833 -65.2986
23.2126 -65.5037
22.6401 -65.7037
22.0658 -65.8988
21.4899 -66.0889

20.9124 -66.2739
20.3333 -66.4538
19.7526 -66.6288
19.1704 -66.7986
18.5867 -66.9633
18.0017 -67.123
17.4152 -67.2775
16.8275 -67.4269
16.2384 -67.5712
15.6481 -67.7103

15.0567 -67.8443
14.464 -67.9731
13.8703 -68.0968
13.2755 -68.2152
12.6798 -68.3285
12.083 -68.4365
11.4853 -68.5393
10.8868 -68.637
10.2874 -68.7294
9.68725 -68.8165

9.08635 -68.8984
8.48476 -68.9751

I plotted these point in Mathematica.


enter image description here


The plot shows a cusp. I would like to modify the plot to round off the cusp.


enter image description here


How can I do this in Mathematica?




Comments

Popular posts from this blog

functions - Get leading series expansion term?

Given a function f[x] , I would like to have a function leadingSeries that returns just the leading term in the series around x=0 . For example: leadingSeries[(1/x + 2)/(4 + 1/x^2 + x)] x and leadingSeries[(1/x + 2 + (1 - 1/x^3)/4)/(4 + x)] -(1/(16 x^3)) Is there such a function in Mathematica? Or maybe one can implement it efficiently? EDIT I finally went with the following implementation, based on Carl Woll 's answer: lds[ex_,x_]:=( (ex/.x->(x+O[x]^2))/.SeriesData[U_,Z_,L_List,Mi_,Ma_,De_]:>SeriesData[U,Z,{L[[1]]},Mi,Mi+1,De]//Quiet//Normal) The advantage is, that this one also properly works with functions whose leading term is a constant: lds[Exp[x],x] 1 Answer Update 1 Updated to eliminate SeriesData and to not return additional terms Perhaps you could use: leadingSeries[expr_, x_] := Normal[expr /. x->(x+O[x]^2) /. a_List :> Take[a, 1]] Then for your examples: leadingSeries[(1/x + 2)/(4 + 1/x^2 + x), x] leadingSeries[Exp[x], x] leadingSeries[(1/x + 2 + (1 - 1/x...

How to thread a list

I have data in format data = {{a1, a2}, {b1, b2}, {c1, c2}, {d1, d2}} Tableform: I want to thread it to : tdata = {{{a1, b1}, {a2, b2}}, {{a1, c1}, {a2, c2}}, {{a1, d1}, {a2, d2}}} Tableform: And I would like to do better then pseudofunction[n_] := Transpose[{data2[[1]], data2[[n]]}]; SetAttributes[pseudofunction, Listable]; Range[2, 4] // pseudofunction Here is my benchmark data, where data3 is normal sample of real data. data3 = Drop[ExcelWorkBook[[Column1 ;; Column4]], None, 1]; data2 = {a #, b #, c #, d #} & /@ Range[1, 10^5]; data = RandomReal[{0, 1}, {10^6, 4}]; Here is my benchmark code kptnw[list_] := Transpose[{Table[First@#, {Length@# - 1}], Rest@#}, {3, 1, 2}] &@list kptnw2[list_] := Transpose[{ConstantArray[First@#, Length@# - 1], Rest@#}, {3, 1, 2}] &@list OleksandrR[list_] := Flatten[Outer[List, List@First[list], Rest[list], 1], {{2}, {1, 4}}] paradox2[list_] := Partition[Riffle[list[[1]], #], 2] & /@ Drop[list, 1] RM[list_] := FoldList[Transpose[{First@li...

front end - keyboard shortcut to invoke Insert new matrix

I frequently need to type in some matrices, and the menu command Insert > Table/Matrix > New... allows matrices with lines drawn between columns and rows, which is very helpful. I would like to make a keyboard shortcut for it, but cannot find the relevant frontend token command (4209405) for it. Since the FullForm[] and InputForm[] of matrices with lines drawn between rows and columns is the same as those without lines, it's hard to do this via 3rd party system-wide text expanders (e.g. autohotkey or atext on mac). How does one assign a keyboard shortcut for the menu item Insert > Table/Matrix > New... , preferably using only mathematica? Thanks! Answer In the MenuSetup.tr (for linux located in the $InstallationDirectory/SystemFiles/FrontEnd/TextResources/X/ directory), I changed the line MenuItem["&New...", "CreateGridBoxDialog"] to read MenuItem["&New...", "CreateGridBoxDialog", MenuKey["m", Modifiers-...