How to draw barplot in this way with Coreplot - core-plot

My image is cannot post so the link is my picture
I want to draw a chart like the image in iOS app
I use the CorePlot to help me to make this
My Question:
How to draw 3 barPlot whit 3 kinds color
How to draw a barPlot from the CPTXYAxis 0 to -4000 in the Upside down way
Any help would be appreciate
Thanks all

A Core Plot graph can have as many plots as you need. They can be the same type or a mixture of different types. Use the identifier property to uniquely identify each plot and check it in the datasource to determine which plot is asking for data. Several Core Plot example apps have multiple plots in a graph; the Plot Gallery is a good place to start.
The "Plot Space Demo" in the Plot Gallery also shows how to "reverse" an axis. Just give it a negative length.

Related

plotly.js "pseudo" histogram for time-series data?

I am trying to figure out how to create this overlaid plot of time-series data, where one of the series should "look" like a histogram.
The problem is I could not figure out how to combine/overlay a histogram with time series data and line/scatter plot and get the histogram xbins to work with the date time data, etc.
So I was also trying to use a bar chart, and create a "pseudo histogram" by removing the gaps between bars, adding outlines, and so forth but that seems fruitless as I don't see a way to control all the borders/lines to that level of control.
The result I am looking for is roughly like so;
Which to me looks like the best match for a plot type should be a histogram, but again I could not figure out how to make that work overlaid with the same x axis as the line/scatter time-series data.
Can anyone offer ideas or point me to an example that might help me understand how to do this ?
I guess I also need to figure out how to align the y-axis scales of the two series also, but that I expect is a different topic...
I am specifically using plotly.js / Javascript

Detecting centers of circles from camera images

So I'm developing an Ionic app that uses the phone camera to detect circles on fabric, like the picture below:
Where the max size is a 3x3 grid and there are 4 different colors (lightblue, darkblue, lightgreen and darkgreen). Basically, I've broken the problem down into 3 steps:
Get the center of each circle.
Get the color at the center of each circle
Using the positions of each circle's center, create a representation of the pattern as a 2d array
My problem is figuring out the best way to achieve step 1. I've looked into the Hough Transform and I can't find very good resources for Javascript. If there is an easier or better way than using the Hough transform I would be very grateful to know.
You can use Image Segmentation with Watershed Algorithm which described in
here
In this type of image, you can do:
Color thresholding in order to find each pattern
(optional) opening + closing in order to clean a little bit your image if the thresholding result is not perfect.
Connected component labeling (see the Union-Find algorithm) in order to separate each component.
Then you have all the patterns, so you can easily find the centers and colors.

Custom line styles for a given range

I'm trying to highlight a portion of a scatter/line plot, but using separate plots for each highlight and get them overlaid on top of the original plot is not working for me because the original plot is doing cubic curve smoothing and I need more points in the highlight than required for the curve to fit the one in the back.
I haven't found any delegate/data source way of specifying a line style for a given range in the documentation. Is there a way of achieving this?
If not possible, is my approach of multiple plots the way to go or is there something else you'd recommend?
There is no way to specify different line styles for separate data ranges. Your solution of multiple plots is the right one, although as you discovered, it won't work with smoothed lines.
You could do the smoothing yourself by turning off the curved line interpolation and adding additional plot points between the known data points. Then you would know where to separate the data for the individual plots.

CorePlot - How to draw a connecting line between two plot symbols from different scatter plots within a graph

I have a graph with two scatter plots. Both plots have data which was recorded over a period of time. For every data point in plot 1, there is a corresponding data point in plot 2. Said another way, Plot 1 and Plot 2 have varying y-values for a given x-value.
I am trying to connect the selected plot symbol for plot 1, with the corresponding plot symbol for plot 2. Is there a specific API to implement this with CorePlot? The delegate methods only ask for a plot symbol so there isn't anything that jumped out to me, and I haven't been able to find any other question here on SO from people with a similar issue.
I have attached an image to illustrate the effect I am trying to achieve.
If CorePlot does not currently support this behavior, my workaround is to add a third plot to the graph. This third plot will only display the plot points for the selected data point from plot 1 and the corresponding data point from plot 2.
Graph with two scatter plots where selected plot symbol is connected to corresponding plot symbol in a different plot.
As long as all three plots use the same plot space, your idea to use a third scatter plot to draw the connecting line is the best solution. Its datasource will be very simple since it only needs two points when it should draw the line, or zero when the selection is hidden. Since it's a separate plot, you can use a different line style to distinguish it from the other plots, too.

Using a straight line in ScatterPlot Coreplot iOS

I'm trying to draw a graph using the coreplot library. I'm looking for a way to change the dataLineStyle of the graph so that all the dots will be connected in a straight line, without any playful turns. If needed, I can provide more information.
Is there any way to achieve this?
[EDIT]
I have included a picture to better understand what I'm talking about. I would not like the Graph Line to go above or under the data points.
Regression lines aren't built into Core Plot. You can use one scatterplot to draw the data points with just plot symbols and no data line. Use a second scatter plot to draw the regression line. It only needs two data points, one for each end of the line. You'll have to compute the regression coefficients yourself.
The lines connecting the data points are controlled by the interpolation property. The default is CPTScatterPlotInterpolationLinear which is what you want.

Resources