Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6640827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:43:05+00:00 2026-05-25T23:43:05+00:00

I have a graph with two plots. One plot shows 10 data points and

  • 0

I have a graph with two plots. One plot shows 10 data points and is static. The second plot should only show one data point that is a function of a slider selection.

However, whenever I move the slider to compute the coordinates of the single data point, the plot generates a whole series of points until I stop sliding. I would like to remove this trail of dots and only show the one represented by the stopping position of the slider. Hope this makes sense.

Here is what the graph looks like (erroneously):

Oops, I’m too new to post an image, but I’m sure you get the picture.

Here is a portion of the code in the slider IBAction:

CPTScatterPlot *dotPlot = [[[CPTScatterPlot alloc] init] autorelease];
dotPlot.identifier = @"Blue Plot";
dotPlot.dataSource = self;
dotPlot.dataLineStyle = nil;
[graph addPlot:dotPlot];

NSMutableArray *dotArray = [NSMutableArray arrayWithCapacity:1];
NSNumber *xx = [NSNumber numberWithFloat:[estMonthNumber.text floatValue]];
NSNumber *yy = [NSNumber numberWithFloat:[estMonthYield.text floatValue]];
[dotArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:xx,@"x",yy,@"y", nil]];

CPTMutableLineStyle *dotLineStyle = [CPTMutableLineStyle lineStyle];
dotLineStyle.lineColor = [CPTColor blueColor];
CPTPlotSymbol *yieldSymbol = [CPTPlotSymbol ellipsePlotSymbol];
yieldSymbol.fill = [CPTFill fillWithColor:[CPTColor blueColor]];
yieldSymbol.size = CGSizeMake(10.0, 10.0);
dotPlot.plotSymbol = yieldSymbol;

self.dataForPlot = dotArray;

I’ve tried to reload the plot with [dotPlot reloadData] and even tried to remove and add back the dotPlot but neither seems to work or, perhaps, I am putting the instructions in the wrong place or wrong sequence.

Any advice would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:43:05+00:00Added an answer on May 25, 2026 at 11:43 pm

    Why are you recreating the scatterplot in the slider action? The only thing you should need to do in that method is update the array that provides the data for the second plot, and call reloadData.

    In any case, the reason you’re getting the trail is that you keep creating new plots and adding them to the graph. The only code that should be in the slider method is:

    NSMutableArray *dotArray = [NSMutableArray arrayWithCapacity:1];
    NSNumber *xx = [NSNumber numberWithFloat:[estMonthNumber.text floatValue]];
    NSNumber *yy = [NSNumber numberWithFloat:[estMonthYield.text floatValue]];
    [dotArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:xx,@"x",yy,@"y", nil]];
    self.dataForPlot = dotArray;
    
    [graph reloadData];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a scatter graph with three plot spaces. One for two y-axis
I have a graph with two plots. The first plot, CPTScatterPlot *boundLinePlot, is very
I have two patch plots on the same graph. One is red and the
I have two graphs with in one image, each with 5 points. Their value
I have two plots (overlaid with clear color background) which are updated every second
I have created a graph with one x-axis and two y-axis. The problem is
I've following data: I want to plot a graph shows for all x the
I have two graph in my program each one can control a USB camera
I have a class Graph with two lists types namely nodes and edges I
Suppose I have two columns in a table that represents a graph, the first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.