I have two data ranges, one contains percentage and other contains total values. Percentage can't be negative and but the total value can be negative.
The issue is that I want the y-axis to be in sync.
http://jsfiddle.net/79cg2u04/
As in above fiddle, percentage bar is starting from the base i.e. 0% is at the bottom. Whereas, for total -400k is at the bottom of the chart. I want the 0 of percent and total to be in sync. If the 0 of total is in the middle (two ticks above the baseline) then 0 of percent should also move 2 ticks above the baseline.
Related
There is a 2000 x 2000 image I, where all pixels in the left half are white and those in the right half are black. A new image (Inew) of the same size is formed from I by shuffling the pixel locations. Then, What is the total number of possible Inew images and What is the average of Euclidean distance across all these possible Inew images?
Given the HighCharts example of a histogram here:
https://www.highcharts.com/demo/histogram
I am looking to make data in the histogram blue columns/bins and the Y axis show as a percentage of the overall dataset rather than the actual values. Example 4 Columns might show 25% / 50% / 10% / 15%
I cannot find an example of this so I am assuming it will require some data manipulation?
I am working with Landsat 8 images. I need to calculate NDVI and display it. For display purpose, I need to scale the NDVI values to 0 to 255 range.
NDVI is basically (p(4)-p(3))/(p(4)+p(3))..where p(4) and p(3) are reflectance corresponding to band 4 and band 3 respectively. These reflectance values can be calculated from metadata available while downloading Landsat imagery.
Now, the metadata file also mentions the maximum and minimum possible reflectance value for the given scene.(* I have attached a picture below).
Now considering a case of p(4) as max value 1.2107 and p(3) as min value -0.09998. The NDVI comes out to be (1.2107-(-0.09998))/(1.2107+(-0.09998)) = 1.18.
The literature I've read about NDVI says NDVI always falls between -1 to 1. But this clearly doesn't follow for the above mentioned case. So I am confused as to what range of NDVI values should I scale to 0 to 255 for display purpose ?
The input values are expected to fall in the range 0 to 1, as they are the ratio of the reflected radiation to the incoming radiation - where 1 represents perfect reflection and 0 represents total absorption of radiation. So, if a plant reflects 20% in band 3 and 80% band 4, your values should be p3=0.2 and p4=0.8.
On a purely intuitive level, we could look at b3 and b4 varyoing between 0 and 1. If both b3 and b4 are either zero or one, the NDVI numerator becomes zero and with it the NDVI ratio. So, we are left with the case where b3=1 and b4=0, which is the opposite of what vegetation does (real vegetation reflects more in b4 than b3), and that would lead to an NDVI=-1. And, finally, the case we are expecting where something reflects nothing in b3 (i.e. b3=0) and reflects perfectly in b4 (i.e. b4=1), this leads to the classic signature of vegetation with an NDVI=1, or at least a relatively high ratio.
Your values are clearly in a different range, so you would need to investigate their units - they should not have any units as they are themselves pure ratios of reflected to incoming radiation.
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.
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.