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

1

5

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.

Shirleyshirlie answered 17/5, 2012 at 8:12 Comment(3)
Can you provide a sample of your code? What have you achieved so far? Consider revising your question with more information.Ostracod
@CaptainRedmuff : Using Set of points i managed to get curve,but they bend according to their pixel positions.. so i want that line to be straight so that it looks smooth curve,without any bend.Shirleyshirlie
See this this and this and this may help you. This explain about coreplot framework.Coreligionist
F
18

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;
Fibroin answered 18/5, 2012 at 1:57 Comment(11)
Google Code: code.google.com/p/core-plot/source/checkout See this wiki page for help with Mercurial: code.google.com/p/core-plot/wiki/UsingMercurialFibroin
I heard about Mercurial to get the smooth curve. But i am not getting how to use it?? Can anyone help ??Ultan
How to use Mercurial or the curved line in a scatter plot?Fibroin
Hi Eric! Tried doing this, downloaded the latest source, built the library from within the associated xcodeproject and copied the file and any headers over. However, I get the following error when trying to run the new code; 'Interpolation method not supported in scatter plot'. I suppose I failed to build the new version of the .a file properly. (I also note that the size of the new .a file is about 2.4 mb compared to the 4.8mb of the binary release from CP1.0). Any pointers? :)Vicissitude
The release package is built from the "Universal Library" target which combines the device and simulator builds into one library. Your app is still linking to an old copy of the Core Plot library. Make sure your app project points to the new library. You might also need to do a clean build.Fibroin
Thanks, working now after building the universal lib and adding it after cleaning out the previous version completely. :)Vicissitude
I downloaded the 1.0 zip and copied the new .a and headers to my project, but the CPTScatterPlotInterpolationCurved is nowhere to be seen - not event in the .h?Advisable
@Advisable - It's not in the 1.0 release. You need to pull the latest code with Mercurial or wait for the next release (not scheduled yet).Fibroin
@Eric Thanks, sorry for the noob question, but I cant seem to figure out how to build the library from the project - I have tried buiding and archiving the different targets but the .a stays red - how should I proceed please?Advisable
Build the "Universal Library" target. The build script will make release builds for both device and simulator and combine them into one library. The static library file will be in the "Release-universal" folder in your build folder.Fibroin
I tried this.. But it doesn't seem to help.. may be some data filtering will do it..Methoxychlor

© 2022 - 2024 — McMap. All rights reserved.