2
$\begingroup$

I have a list of the form

    data={{0.5, 3.14026}, {0.525, 3.13121}, {0.55, 3.1222}, {0.575, 
  3.11323}, {0.6, 3.10429}, {0.625, 3.0954}, {0.65, 3.08654}, {0.675, 
  3.07772}, {0.7, 3.06894}, {0.725, 3.0602}, {0.75, 3.0515}, {0.775, 
  3.04284}, {0.8, 3.03421}, {0.825, 3.02563}, {0.85, 3.01708}, {0.875,
   3.00857}, {0.9, 3.0001}, {0.925, 2.99168}, {0.95, 2.98329}, {0.975,
   2.97493}, {1., 2.96662}, {1.025, 2.95835}, {1.05, 2.95011}, {1.075,
   2.94192}, {1.1, 2.93376}, {1.125, 2.92565}, {1.15, 
  2.91757}, {1.175, 2.90953}, {1.2, 2.90153}, {1.225, 2.89357}, {1.25,
   2.88565}, {1.275, 2.87777}, {1.3, 2.86993}, {1.325, 
  2.86212}, {1.35, 2.85436}, {1.375, 2.84663}, {1.4, 2.83895}, {1.425,
   2.8313}, {1.45, 2.82369}, {1.475, 2.81612}, {1.5, 2.80859}, {1.55, 
  2.79365}, {1.6, 2.77888}, {1.65, 2.76426}, {1.7, 2.7498}, {1.75, 
  2.7355}, {1.8, 2.72135}, {1.85, 2.70736}, {1.9, 2.69351}, {1.95, 
  2.67981}, {2., 2.66626}, {2.05, 2.65284}, {2.1, 2.63957}, {2.15, 
  2.62644}, {2.2, 2.61345}, {2.25, 2.60059}, {2.3, 2.58787}, {2.35, 
  2.57528}, {2.4, 2.56282}, {2.45, 2.55048}, {2.5, 2.53828}, {2.55, 
  2.5262}, {2.6, 2.51424}, {2.65, 2.5024}, {2.7, 2.49069}, {2.75, 
  2.47909}, {2.8, 2.46761}, {2.85, 2.45624}, {2.9, 2.44499}, {2.95, 
  2.43385}, {3., 2.42282}, {3.125, 2.39573}, {3.25, 2.3693}, {3.375, 
  2.34351}, {3.5, 2.31835}, {3.625, 2.29378}, {3.75, 2.2698}, {3.875, 
  2.24639}, {4., 2.22352}, {4.125, 2.20119}, {4.25, 2.17938}, {4.375, 
  2.15806}, {4.5, 2.13723}, {4.625, 2.11688}, {4.75, 2.09698}, {4.875,
   2.07753}, {5., 2.05851}, {5.125, 2.03991}, {5.25, 2.02172}, {5.375,
   2.00393}, {5.5, 1.98652}, {5.625, 1.96949}, {5.75, 
  1.95282}, {5.875, 1.93651}, {6., 1.92054}, {6.125, 1.90491}, {6.25, 
  1.88961}, {6.375, 1.87462}, {6.5, 1.85995}, {6.625, 1.84557}, {6.75,
   1.8315}, {6.875, 1.8177}, {7., 1.80419}, {7.125, 1.79095}, {7.25, 
  1.77798}, {7.375, 1.76526}, {7.5, 1.7528}, {7.625, 1.74058}, {7.75, 
  1.7286}, {7.875, 1.71685}, {8., 1.70534}, {8.125, 1.69404}, {8.25, 
  1.68296}, {8.375, 1.6721}, {8.5, 1.66144}, {8.625, 1.65099}, {8.75, 
  1.64073}, {8.875, 1.63066}, {9., 1.62078}, {9.125, 1.61109}, {9.25, 
  1.60157}, {9.375, 1.59223}, {9.5, 1.58307}, {9.625, 1.57407}, {9.75,
   1.56523}, {9.875, 1.55655}, {10., 1.54803}, {11., 1.48512}, {12., 
  1.43045}, {13., 1.38275}, {14., 1.34098}, {15., 1.30427}, {16., 
  1.27192}, {17., 1.24334}, {18., 1.21802}, {19., 1.19554}, {20., 
  1.17555}, {21., 1.15774}, {22., 1.14185}, {23., 1.12764}, {24., 
  1.11493}, {25., 1.10355}, {26., 1.09334}, {27., 1.08417}, {28., 
  1.07594}, {29., 1.06853}, {30., 1.06187}, {32., 1.05048}, {34., 
  1.04122}, {36., 1.03369}, {38., 1.02755}, {40., 1.02254}, {42., 
  1.01845}, {44., 1.01511}, {46., 1.01238}, {48., 1.01014}, {50., 
  1.00831}, {55., 1.00506}, {60., 1.00308}, {65., 1.00188}, {70., 
  1.00115}, {75., 1.0007}, {80., 1.00043}, {85., 1.00027}, {90., 
  1.00018}, {95., 1.00013}, {100., 1.00012}}

I want to plot my data with in the interval 0 to 60. So, I use

ListPlot[data, PlotRange -> {{0, 60}, {0, 4}}]

However, as I have many points in the interval 0-10, the dots of ListPlot agglutinate in such interval. How can I overcome such agglutination without having to erase some points manually? Is there a way to choose which points to plot and which ones to exclude? Lets say I want the dots to be separated be a distance of 2, or 3, or whichever I see fits best. Thanks in advance.

$\endgroup$
  • 1
    $\begingroup$ does ListLinePlot[data, Mesh -> {100}, MeshFunctions -> {#&}, MeshStyle -> Opacity[1,ColorData[97][1]], PlotStyle->None] or ListLinePlot[data, Mesh -> {100}, MeshFunctions -> {Piecewise[{{#,#>=20}},.5#]&}, MeshStyle -> Opacity[1,ColorData[97][1]], PlotStyle->None] something close to what you need? $\endgroup$ – kglr Oct 17 '19 at 19:57
4
$\begingroup$

Perhaps:

ListPlot[DeleteDuplicates[data, EuclideanDistance[##] < 1.2 &]]

enter image description here

Connecting the dots might be appropriate in some cases:

ListLinePlot@data

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ The issue is that I'm also plotting other variables, so I need to distinct between one and the other. Therefore, ListLinePlot does not do the trick. $\endgroup$ – Adrián Silva Caballero Oct 17 '19 at 18:54
  • 2
    $\begingroup$ Well I did say “in some cases.” BTW, ListLinePlot can distinguish variables. What about the first solution which is the principal answer to the question you asked? You did not comment on it $\endgroup$ – Michael E2 Oct 17 '19 at 19:14
  • $\begingroup$ @MichaelE2 Very tricky and useful first solution! Could you please explain in more detail the use of slotsequence inside DeleteDuplicates[data, EuclideanDistance[##] < eps & ]. I would have expected two arguments?? Thanks. $\endgroup$ – Ulrich Neumann Oct 18 '19 at 7:49
  • $\begingroup$ @UlrichNeumann SlotSequence[] stands for #1, #2 in this case. $\endgroup$ – Michael E2 Oct 18 '19 at 10:49
  • $\begingroup$ @MichaelE2 Thanks, that's understood. And #1,#2 are pairs of listelement of data? $\endgroup$ – Ulrich Neumann Oct 18 '19 at 11:13
2
$\begingroup$

To get a different perspective

ListLogLinearPlot[data, PlotRange -> {{0, 60}, {0, 4}}]

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ I want to keep the real scale, as I'm plotting against another functions and other Lists. I have other two Lists, and three functions. My other lists, also have similar issues as they have many points in the inner interval (0.5-10). I want to distinct between them, so they may be distinguishable even if they are printed in a grayscale. Only using Dashing is not doing the job done, because some of them overlap $\endgroup$ – Adrián Silva Caballero Oct 17 '19 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.