Use linkdata to change number of histogram bins from a slider - histogram

I'm currently working on plotting a histogram that changes the number of bins as I use a slider. I have the histogram plotted along with a set number of bins saved to variable "nbins". I also have a uicontrol slider. How would I change the value of nbins as the slider value changes while updating my plot in real time? Thanks!

Related

Scaling y-axis of a histogram

I am creating a histogram of an image. I need a way to scale it in y-axis to represent it nicely, as standard image/video processing programs do. Thus I need to make stronger the small values, to make weaker the big values.
What I tried to do so far:
To scale the y-values by dividing them by the greatest y value. It allowed me to see it, but still small values are almost indistinguishable from zero.
What I have seen:
In a standard video processing tool let's say three biggest values have the same y-values on their histogram representation. However, real values are different. And the small values are amplified on the histogram.
I would be thankful for the tips/formula/algorithm.
You can create lookup table (LUT), fill it with values from a curve that describes desired behavior. Seems that you want something like gamma curve
for i in MaxValue range
LUT[i] = MaxValue(255?) * Power(i/MaxValue, gamma)
To apply it:
for every pixel
NewValue = LUT[OldValue]

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.

Analyzing an Image's histogram

I have a photo editing app that is built around Brad Larson's amazing
GPUImage framework.
I need a way to analyze an image's histogram so i can return it's range.
Meaning the real range of "activity".
I need this to improve a tool i have in the app that controls the RGB composite curve.
Is there a way to analyze or retrieve hard numbers from the histogram filter in GPUImage ? any other way to do it?
As I document in the Readme.md for the GPUImageHistogramFilter:
The output of this filter is a 3-pixel-high, 256-pixel-wide image with
the center (vertical) pixels containing pixels that correspond to the
frequency at which various color values occurred. Each color value
occupies one of the 256 width positions, from 0 on the left to 255 on
the right. This histogram can be generated for individual color
channels (kGPUImageHistogramRed, kGPUImageHistogramGreen,
kGPUImageHistogramBlue), the luminance of the image
(kGPUImageHistogramLuminance), or for all three color channels at once
(kGPUImageHistogramRGB).
To get the numerical values for the histogram, have the GPUImageHistogramFilter output to a GPUImageRawDataOutput and grab bytes from that. The result will be a 256x3 (width, height) array of 0-255 values indicating the intensity at each color component. You can ignore the first and last rows, as the values are only present in the center row.
From there, you can analyze the histogram obtained by this operation.

CorePlot YAxis with two types of Scaling

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.

Resources