Core Plot - Filling color for multiple plots with bounded confidence intervals - core-plot

I would like to plot multiple curves on a graph. These plots would have shading of a different color for each with certain bounds around them. Please let me know if anyone has any suggestions. I will really appreciate it.
Thank you,
Santosh
P.S.: I was not able to attach an image as illustration to understand the problem statement. My apologies. I have posted this question on the Google groups. Once approved, I will edit this post to add the link from there for the image.

This isn't easy right now. You might be able to make it work by creating a closed shape with the plot. Give it data points from left to right along the top of the curve and more points that define the bottom of the curve from right to left.
Core Plot issues 13 and 99 will address this problem, although there is no timeline for a fix right now.

Related

Draw text along a path on a map (like f.e. a street-name)

I am currently trying to label lines that I draw in my Map (in my iOS app, but I guess it applies to all maps).
So what I currently am doing, I simplify my path so that I get rid of most small curves and then just draw my glyphs along that line. Currently that looks like this:
On some parts of the line that's already ok. If the line is quite straight and the corners aren't too spiky.
But in some parts you can just not read anything... So what are strategies to make that look nicer?
Does anybody know an algorithm or a strategy on how to make my path look like the red line here:
I am happy about any ideas on how to improve my drawing :)
I do it, in my commercial map rendering system, by finding a portion of the line without sharp corners. There is no way to make the label look good if it turns corners of a right angle or greater. If there's no section long enough I abbreviate the label (e.g., Link Road becomes Link Rd), or split it on to two lines. If there's still nowhere to draw the label I don't draw it.
Another thing that's important is to adjust the spacing so that ascenders and descenders don't clash, so you need to look at the bounding box of each adjacent pair of letters as you draw the text and add small amounts of space as necessary.
I don't bother to smooth my lines, as you suggest with your red line. It really doesn't seem to matter, at least with street labelling.

Drawing a grid of circles in xcode/swift

How would I go abouts getting an effect in a view controller like the wonderful work of art attached in the following link?
Circles
I do have some idea, ranging from actually using ASCII text (I know, super wrong way) to a collection view of pictures, to what I suspect is the "right" way, done with core graphics. But I am asking in case there is a super easy/right methodology I will one day discover and facepalm.
You are correct that there are two primary ways for you to draw a grid of circles.
The primary way is to draw them using UIBezierPath or by using a collection view of images of circles.
For simple shapes, it is recommended that you choose the first option simply because your choices of circles aren't restricted by your images.
Here is a link for you to get started.

Shape changing blobs

Ok, I'm not quite sure if this is something I can ask here so no need to shoot me down. Just tell me and i'll delete the question :)
I had this idea of making my own clock using a touch screen and program it myself.
While thinking about this I thought of all these different styles to show the current time.
Of all the styles I came up with there was one that I found the most fun which is a clock displaying the time Rorschach style. And no not just a random smudge and guess what time it is but more like Rorschach in watchmen.
He has a mask with inkblots that constantly change shape (really cool if you ask me).
So what I had in mind is inkblots that change shape according to the digit it represents.
When the time changes
12:49:58 -> 12:49:59 the 2nd second digit will transform from 8 -> 9.
So now back to the original problem:
Before attempting to get this type of clock running I want to try to give a blob a certain shape and make it transform into another shape.
I searched on google but without any luck so I was hoping there was someone here that could point me in the right direction for making a random blob and transform it into another shape in an animation.
For example:
Draw square -> animate to circle
Any tips and tricks are welcome :)
In order to get the most simpliest animation of digit transformation you could store all posible digits in one image (verticaly) and then only partially show that image in your component. So when you want to do transformation between one digit to another you simply slide the image up and down.
Now if you are using FireMonkey you could create a 3D viewport and inside it create a cylindical object onto which will you render your texture with digits. So now you only rotate the cilinder in order to show the corect digit.

Growing a visual tree with rectangles?

Given rectangle-shaped bars (say, of size 50x10), how would I grow-draw them to something that looks like a tree? A starting point is given where a semi-randomly bar is added, and then a new bar or two are added to every end of the old rotation, rotated by themselves, and with new bars added at their end, and so on to some point. I suppose it's a geometry question -- how do I find the correct bar ends to stick the new rotated bar too?
I'm using Lua, but any pseudocode would help, thanks!
Have a look at L-systems. They can be used to create plant-like structures. The Wikipedia article has many references to sites where you can toy with these.
Let's see if I understand well the core of your problem: you have a segment (bar) which you rotate around one of its sides by some angle and you want to know the position of the other end of the bar after that.
Isn't what you're looking for just the geometric definition of sine and cosine?
See below, sorry for my awful drawing skills :)
To make it "stick" just rotate around the right corner of the rectangle depending on the angle, like so:

Can I animate the range of a Core Plot scatter graph?

I have a Core Plot scatter plot in an iOS app that I'm using to show some data. When the view loads I calculate the ideal ranges for the plot to fit its data on screen. I allow the user to zoom and pan, but include a button to return the graph to those ideal ranges.
The button works and the ranges change appropriately, but the change can be a bit jarring. One loses their mental 'map' of the plot because of the abrupt change. It would be much nicer to animate the pan and scale as necessary, like maps apps do.
I didn't see anything built into Core Plot that allows animation of this, but I may have missed something. Is there a way to do this with Core Plot (or a fork of it) or a reasonably easy way to do it manually?
In case anyone is wondering about this now, Eric's fix has been put in place and you can now animate a range using the following code:
CPTPlotRange *xRange = [CPTPlotRange
plotRangeWithLocation:CPTDecimalFromDouble(location)
length:CPTDecimalFromDouble(length)];
[CPTAnimation animate:plotSpace // CPTPlotSpace *
property:#"xRange"
fromPlotRange:plotSpace.xRange
toPlotRange:xRange
duration:5.0
withDelay:0
animationCurve:CPTAnimationCurveCubicInOut
delegate:nil];
The best solution available for now involves using a timer to adjust the range in small steps. I'm working on a more general solution, but it's not ready to include in the public code yet. Watch the status on Core Plot issue #398 to find out when the fix becomes available.

Resources