Sample Tutorials Of Plotting A 2D Graph On Phone SDK - iphone

Can someone give me some good tutorials on Creating a 2D plot on IPhone given a variable number of x,y coordinates?

If you're looking for something beyond just plotting the points, check out the open source Core Plot framework for Mac and iPhone. It's still a young project, but it can handle a scatter plot (with or without lines between the points) along with labeled axes just fine. There are a number of example programs included with the framework that demonstrate some of its capabilities.

You can do this with the CGContextAddLineToPoint method.
http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html#//apple_ref/doc/uid/TP30001066-CH211

Related

bezier curve in objective c using coreplot

i am developing one app in iPhone in that application i want smooth curve using core plot frame work.can any one suggest how to implement smooth curve
thanks in advance.
A new interpolation mode, CPTScatterPlotInterpolationCurved, was added after the 1.0 release. It will draw bezier curves between each point in the scatter plot. You can get support for it by pulling the latest code with Mercurial or wait for the next release.

How to Draw SMOOTH curve using different points in coreplot ios?

I am able to plot a curve, but it is not smooth. In fact, it is totally distracted and wavy. Can anyone help me or suggest a method to make that curve line smooth?
Thanks in advance.
A new option was added to the Core Plot framework after the 1.0 release that draws scatter plots with a smoothed line. You'll need to get the latest code with Mercurial or wait for the next release, currently unscheduled.
plot.interpolation = CPTScatterPlotInterpolationCurved;

Draw graph using accelerometer data in core-plot

I'm new to this core-plot framework and trying to draw a line graph based on X and Y acceleration. I can already get my X and Y values and have successfully added core-plot in my project. I'm quite lost on how to start this, so basically, I will have X and Y values and how do I plot this using core-plot? any help is suggested. Thanks!
Maybe my answer is a little bit off topic, as it's not using core-plot, but did you look at the "AccelerometerGraph" sample app provided with Xcode?
It provides a nice plot which is dynamically updated while new accelerometer events are registered. The great of this sample is the way CoreAnimation has been used to "speed-up" Quartz2D. And you get all of this using system framework only and no third party code (apart your adaptation of Apple's one).
Look at the Core Plot examples to see how to set up a basic graph. You'll want to use a scatter plot. Call -reloadData on the plot whenever you have new data to display. If only some of the data points change on each frame, you can use the following methods to do a partial update:
-(void)reloadDataInIndexRange:(NSRange)indexRange;
-(void)insertDataAtIndex:(NSUInteger)index
numberOfRecords:(NSUInteger)numberOfRecords;
-(void)deleteDataInIndexRange:(NSRange)indexRange;
The Real Time Plot in the Plot Gallery example app shows one way to use these methods.

IPHONE - Plotting location in UIView with XY coordinates iphone SDK

Here is my question , I want to create a soccer match team formation for an app base on the X and Y coordinates return.
Does anyone have the example or tutorial?
There is a really good framework for plotting called Core Plot. I tried that before, it's a great framework you can draw plot like you deal with TableView. If you serious about plotting the you should have a look at it. If not then it maybe a bit over-kill.

Draw ECG graph dynamically in iphone?

HI All,
Is there any way to draw a 2d graph of ECG (in wave form) in iphone .I am getting a large anount of data in couple of seconds i mean the gap will be of just 1 Secs.then is there any way to draw the graph in iphone or any library (IN c or c++) by which i can use it and it draw a live graph of any heart beat analysis and looks alike a live video.
Thanks
Balraj.
Apple's Accelerometer example app (available on their iOS developer site, and with full source code) shows how to draw a 2D graph animated several times a second.
In addition to the Accelerometer sample that hotpaw2 points to, which is reasonably performant when it comes to graphing realtime data, there is the Core Plot graphing framework. Core Plot can give you a drop-in component with more options when it comes to formatting your graphs, but it may not be the fastest for displaying many data points that change rapidly on the iPhone.