If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Data Frequency
Hello, I have over 100,000 data points. I would like to do a scatter plot of
every 10th or 100th point. What is the best way to accomplish this task? |
#2
|
|||
|
|||
Data Frequency
Kyle wrote:
Hello, I have over 100,000 data points. I would like to do a scatter plot of every 10th or 100th point. What is the best way to accomplish this task? You could copy the data to a separate range for charting. Use a formula like =MOD(ROW(),100) then filter on the new formula column for any single value to see every 100th row, copy visible cells, paste elsewhere, and chart. |
#3
|
|||
|
|||
Data Frequency
Kyle,
More meaningfully you should select the appropriate number of reduced points, regardless of a changing number of original ones. This, in a comfortable way, can be achieved by the following macro. You are free to add mandatory prefices to variable names. Option Explicit Sub DataReduction() 'Petr Bezucha, 2008 'Subroutine reduces the count of xy data points to a set number 'and places the new range into the set position. 'Prerequisition is that the variables x and y 'should occupy the neighboring columns Static PtsCount As Long Dim DataCount As Long, DataStep As Long, S As Range, _ XO As Range, XR As Range, Inp As String, _ CO As Long, CR As Long, RO As Long, RR As Long, RM As Long Const Title As String = "Data reduction" 'starting proposal If PtsCount = 0 Then PtsCount = 50 'dispatching inputs Set S = ActiveCell On Error GoTo ErrExit 'cell selections are necessary Set XO = Application.InputBox _ ("Select the upmost X-original cell", _ Title, S.Address, , , , , 8) Set XR = Application.InputBox _ ("Select the upmost X-reduced cell", _ Title, S.Offset(, 2).Address, , , , , 8) On Error GoTo 0 CO = XO.Column CR = XR.Column Inp = CStr(PtsCount) Inp = Application.InputBox("Number of reduced points", _ Title, Inp, , , , , 1) PtsCount = CLng(Inp) Application.ScreenUpdating = False RO = XO.Row RR = XR.Row DataCount = XO.End(xlDown).Row - RO + 1 DataStep = DataCount \ PtsCount RM = XO.End(xlDown).Row - DataStep Do While RO RM Cells(RO, CO).Copy Destination:=Cells(RR, CR) Cells(RO, CO + 1).Copy Destination:=Cells(RR, CR + 1) RO = RO + DataStep RR = RR + 1 Loop Application.ScreenUpdating = True ErrExit: End Sub -- Petr Bezucha "Kyle" wrote: Hello, I have over 100,000 data points. I would like to do a scatter plot of every 10th or 100th point. What is the best way to accomplish this task? |
Thread Tools | |
Display Modes | |
|
|