Skip to main content
added 5 characters in body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Sometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only intreatedinterested in the range set in the ListPlotListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlotListPlot does drop the data outside the range, see example here.

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Sometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only intreated in the range set in the ListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example here.

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Sometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only interested in the range set in the ListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example here.

replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Sometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only intreated in the range set in the ListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example herehere.

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Sometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only intreated in the range set in the ListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example here.

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Sometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only intreated in the range set in the ListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example here.

add more explanation
Source Link
xslittlegrass
  • 28k
  • 9
  • 105
  • 190

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

AreSometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only intreated in the range set in the ListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example here.

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example here.

Consider this list plot

ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] 

enter image description here

If we look at the data in the plot, we see that all the data in ls are included in the plot.

ls2 = p[[1, 2, 1, 3, 3, 1]]; Dimensions[ls2] (* {1001, 2} *) ListPlot[ls2, Joined -> True] 

enter image description here

Sometimes this is really helpful because we can just retrieve the data at a later time from the plots and don't need to regenerate the data again. But sometimes I'm only intreated in the range set in the ListPlot, and saving all the data is kindly of wasting of space, especially when I have many plots in a notebook, the notebook size becomes very large and not very responsive.

So are there simple ways to tell ListPlot to not include the data outside the plot range, other than manually select the data before plot?

P.S. Sometimes, ListPlot does drop the data outside the range, see example here.

Tweeted twitter.com/#!/StackMma/status/453307732385619970
Source Link
xslittlegrass
  • 28k
  • 9
  • 105
  • 190
Loading