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.
Related
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
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.
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.
I want to plot lines between (distant) points on an Openlayers 3 map (which uses Open Street Map tiles). I want the lines to be seen as curves, as with flight paths, since they should take the shortest real world surface path: a geodesic (a great circle segment).
Is this possible?
Would I need to interpolate the points along the geodesic (how?) and plot a bunch of line segments, or is there an easier way? Is there something built in I can't find, or a library for it?
Looking at OL3's Flight Animation Example, it appears to be possible using the arc.js plugin: “A great circle arc between two airports is calculated using arc.js and then the flight paths are animated with postcompose. The flight data is provided by OpenFlights (a simplified data set from the Mapbox.js documentation is used).”
Does anyone know a way in which i can AUTOMATICALLY plot a "tendency" line for an output of a visualization in WEKA? (See images)
What i want to achieve:
In the second image, I just plot the polyline on my own which is very open to bias and error.
What i want to achieve is a line which describes where the point may actually lie. Like a tendency to do so (as the approximation in the 2nd image)