Multiple scatterplots using Core Plot and Swift
For a starter, create two CPTScatterPlot
s (e.g. boundLinePlot1
& boundLinePlot2
)and configure them with different colors and different identifier
then add them
boundLinePlot1.identifier = "Blue Plot"
boundLinePlot2.identifier = "Green Plot"
newGraph.addPlot(boundLinePlot1)
newGraph.addPlot(boundLinePlot2)
Now in the Plot Data Source Methods (numberOfRecordsForPlot
& numberForPlot
) calculate return value based on plot.identifier
if plot.identifier == "Blue Plot" {
return dataForPlot1[Int(recordIndex)][plotField!]
} else {
return dataForPlot2[Int(recordIndex)][plotField!]
}
How to add offset between two scatter plot graphs using coreplot
If barWidthsAreInViewCoordinates
is NO (the default), you can just add or subtract the barOffset
from the x or y coordinate in the datasource.
Core-Plot: Removing line that connects points in Scatterplot?
You can hide lines in Core Plot by setting the corresponding line style to nil
.
scatterPlot.dataLineStyle = nil;
Related Topics
Onreceive String.Publisher Lead to Infinite Loop
How to Exit a Function Scope from Inner Function Using Swift
Swift: Benefits of Curry Function
(Key: Anyobject, Value: Anyobject)' Does Not Have a Member Named 'subscript'
Retrieving Common Values in Firebase
What Is This Syntax: Func Funcname(Stuff1)(Stuff2)->Returntype {}
Why Is My App Returning Hundreds of Errors That Say "Undefinedsymbol"
How to Resize an Image That Is Being Printed
How to Detect When Two Objects Touch in Spritekit
Swift - Scanning with Ikscannerdeviceview on Osx
Multiple Scatterplots Using Core Plot and Swift
Images Being Flipped When Adding to Nsattributedstring
Add Catextlayer on Top of Nsimageview
Calling C++ from Swift - What Is The Equivalent of Std::Vector<T>
Error Validating Cms Signature
Realitykit - Add Force to Entity at Specific Point