09-22-2015 04:35 AM
Hello every one,
I want make a graph for my project. This graph in x axis date and y axis is value. I have done this XY graph.
Now I want two conditions
One is draw the average value of total value. Then Plot filling point's Color will be change according to the average value. For example my data values are between 286 to 295 (any value of this in between) my average value is 290.6. So above 290.6 is filling point color is GREEN And below average value is RED. This is actually I want .I have done plot my data and also average value. But I tried to change color I could not get. So please answer me any one. How can I do this Task?
Thanks in advance
Arunkumar M
India
I have attached actual output and required output
Solved! Go to Solution.
09-22-2015 07:08 AM
All points in a plot must have the same color. What you can do is create a 3rd plot that is no line and has red points. You can create a plot that contains all of the "bad" XY pairs and plot that. Make sure your plot number is such that the red points will plot overtop the green points
09-22-2015 07:24 AM
I posted a similar suggestion yesterday on the forum -- if your data being plotted are Floats, then you can use the feature that NaN (Not a Number) values don't plot. So if you have an array of points, say "Green Values", and want all values greater than 200 to plot Green and all values less than (or equal to) 200 to plot Red, make a copy of Green called (of course) Red, replace all Green values <= 200 with NaN, all values of Red >200 with NaN, set the color of Green to (are you ready?) Green, the color of Red to Red, and plot both. The non-NaN Green values will appear in Green, the non-NaN values of Red will appear in Red, and the NaN values won't plot.
Bob Schor
09-22-2015 07:30 AM
I saw that too and was first thinking this was the same question.
I'd argue two things.
1. The OP says this is an XY plot, so no need to fill in the "missing" data with NAN.
2. You want one plot to contain all the data that way you have all the lines connecting the points. You want the 2nd plot to have no lines, and only contain the "bad" data so that it plots the red points thata will cover over the green points.
09-22-2015 12:54 PM
Good point -- I often confuse Charts and Graphs. If there are no "connecting lines", I suspect that both ways would be functionally equivalent (though the programming would be slightly different). Your method has the virtue that it works with integer quantities (without needing to cast the data to a Float to get the inclusion of NaN).
BS
09-23-2015 12:23 AM
Thank you for your reply Mr.RavansFan and Mr Bob_Schor . I got exactly output .
I have attached my output image .
again thanks a lot.
Arunkumar M
India
09-24-2015 04:20 PM
Great! Which solution did you use, mine or Ravens Fan's? It would be helpful for the next person who wants to do this if you say which method "worked for you".
Bob Schor
09-25-2015 01:30 AM
Hi Bob,
Actually First I tried Revan idea. This is working fine but i couldn't skipped the else values , that place automatically plot zero. So I used your condition (if place i used acutall value and else place i used NaN) this gave accurate output.
So your Idea is working good.
Thanks
Arunkumar M
India
09-25-2015 08:46 AM - edited 09-25-2015 08:47 AM
I'd like to see the attempt using my idea. If the data is actually set up as X,Y pairs like the earlier graphs seemed to indicate, I don't see why it wouldn't work. (They weren't waveform charts or waveform graphs because the X values weren't equally spaced.)
Depending on how the original data was structured, there are multiple ways of sending data to an XY graph, would determine what is the easier method.