CorePlot YAxis with two types of Scaling - ios

Is it possible to achieve different scaling for positive part of Y-axis and different scaling for its negative part of Y-axis.The idea is to show most part of plot area for positive values and less part for negative values.

Set the yRange of the plot space so that 20% of the range is negative. For example, a range with a location of -25 and length of 125 meets this requirement.

Related

Contrast stretching over a small range of intensities

What's the use of applying contrast stretching over a small range of intensities in an image (take, for example, the intensity transform below)? I have the same question for contrast shrinking.
Contrast stretching for the entire range of intensities can make the image clearer (so it's benefit is obvious in particular cases). My guess is that stretching the contrast over a small range of intensities makes the areas with those intensities more distinguishable.
Just have a look at the graph you provided (although a graph without axis labels is pretty useless by itself)
The vertical axis of your graph is the output intensity. The horizontal axis is the input.
If we interpret your graph like that we see that a few low input values will be spread (stretched) across a wider range of output values.
The following input values are compressed into a smaller output inverval while teh rest of our input values stays unchanged.
Humans have problems to distinguish between very similar intensity values.
The following black rectangles both show a square on a square.
In the left one its intensity 5 on 1 and on the right its 50 on 10.
So by stretching the interval 1:5 by factor 10 I made the rectangle visible as I increased the contrast.
So if you have information in a small region of gray values you can stretch it to make it more visible to humans. Computers usually don't care.
Shrinking has the opposite effect. You decrease contrast. This makes sense for an intensity range that bears no information. Why waste that interval?
As we only have a limited amount of gray values, we of course can only stretch one section if we sacrifice another one (by shrinking it)

Proportional Pie-charts using High-Charts

I am working with High Charts to plot two pi charts which I need to be proportional. I have calculated the radius of each, but can't find a way to specify a radius for each pi chart. How can I do this?
Use pie series size property.
From docs:
size: String|Number
The diameter of the pie relative to the plot area. Can be a percentage or pixel value. Pixel values are given as integers. The default behaviour (as of 3.0) is to scale to the plot area and give room for data labels within the plot area. As a consequence, the size of the pie may vary when points are updated and data labels more around. In that case it is best to set a fixed value, for example "75%". Defaults to .
example

How to draw y-axis by dynamic values by using YLow and YHigh

I am using core plot library for drawing the graph. I always get dynamic values for y-axis and I calculate Ymin and Ymax from the result set. The difference between (Ymax-Ymin) may be very low or very high. I want to create dynamic intervals between these values. If the difference is low major interval should be less and if it is high major interval should be high. I can't set the preferredNumberOfMajorTicks static value as values may vary. The code should work for every case. Please guide me with some code example.
#Eric Thanks for the response. I tried both of your solutions.First oneCPTAxisLabelingPolicyEqualDivisions but it always divides the range in one interval say if yMax and yMin are (128.5 and 123.2) then one interval seems nice but if values are (5550-100) then also it shows only one interval with such a big difference of values.Secondly I tried with CPTAxisLabelingPolicyFixedInterval and calculated the majorIntervalLength with by dividing the length by different number of intervals,it works fine but again I don't want to keep the value of interval static .As if I divide the length by 4 then it will always create 4 intervals even for the very low values say 4.5 and 3.5. Can you please guide me if there is any way to calculate the no of intervals by yMax and yMin?
Try the CPTAxisLabelingPolicyAutomatic axis labeling policy. That will pick "nice" intervals within the plot range for the ticks and labels. You can use the CPTAxisLabelingPolicyEqualDivisions labeling policy to always divide the plot range into equal parts, although there are no guarantees that the ticks will be on
"nice" values. If you want the most control, stick with the default labeling policy (CPTAxisLabelingPolicyFixedInterval). Divide the length of the plot range (Ymax-Ymin) by the desired number of intervals to compute the majorIntervalLength.

Margin for scatter series in Shinobi Charts on iOS

I'm using a scatter series in Shinobi Charts but points with maximum and minimum x and y values are being truncated because they're at the edge of the plot area?
How can I add a small margin to the plot area so I can clearly see the scatter points and none are truncated. I realise that I can set the range of each axis myself but that gets into nasty math to work out what a 5px margin would be over the lowest/highest values etc.
There are 2 properties on SChartAxis which can help you: rangePaddingLow and rangePaddingHigh. These values are absolute values, and in the scale of the axis.
For example, if you have an axis which has an automatic range of (0,100), then the following would update the range to (-5, 105):
axis.rangePaddingLow = #5;
axis.rangePaddingHight = #5;
As the axis scale updates, these padding values will be maintained.

Core Plot - X-Axis moving position when plotting less points

I have a strange problem where my x-axis moves down the plot area when I'm plotting less points. My graph has 2 lines plotted - 1 for previous year and 1 for current year values. My original graph always plotted 12 points for both lines, regardless of which month we are in and this works fine. I have now changed my app so that the current year line only plots points upto the current month. E.g. we are in May so I only plot 5 points. When I do this the x-axis moves down the plot area so that it is detached from the y-axis and the labels are hidden - see screenshots :
Why would simply reducing the number of plot points change the x-axis position? I'm using Core Plot 1.1 (static library) and Xcode 4.6.2.
The yRange of the plot space changed so the point where the x-axis crosses the y-axis is now too close to the bottom edge of the graph. You have two options:
Ensure the yRange always puts the crossing point (the "orthogonal coordinate") far enough from the edge that the labels and title remain visible.
Use the axisConstraints to position the axis a fixed distance from the edge of the graph. This will let the crossing point float along the y-axis.
The plotting library changes the x-axis position because generally core plot take the minimum and maximum range among the values of y axis. You when you provide only 5 points then the lowest value is taken from y axis values and there for x- axis position while when you were providing all 12 months values the lowest value of the rest of the month were 0 and therefore x-axis was at zero. You can change the maximum and minimum values for the y range in core plot.

Resources