Discussion:
Color changing plot
(too old to reply)
Cory K
2008-07-31 19:40:09 UTC
Permalink
I just finished a program and wanted to add a few things just to make it look nice.
One thing I wanted to do, if possible, is the following:
 
I have an XY chart.
Say, I have a range of 0 - 100.
Can I make the segment of line that is below 33 be red, 33-66 be yellow, 66-100 be green?
 
I would assume there is some property node that controls that, but I can't find it.
Thanks
jmcbee
2008-07-31 19:40:10 UTC
Permalink
I think the best way to do that would be to take your single plot and make it into plot three plots on your xy graph, with each plot representing one of the data ranges.  This way you can use a property node to change the color of each plot so that it is represented as you want.  The property you want is Plot>>Fill/Point Color.
Cory K
2008-07-31 19:40:10 UTC
Permalink
There is no way I can make the color change?
jmcbee
2008-07-31 19:40:11 UTC
Permalink
You can make the color change for each plot, but this would mean that your XY graph would have only one color.  By breaking your plot into three plots (0-33,34-66,67-100?) you can color each individually by using a property node, setting the active plot and then changing the fill/point color.
TonP
2008-07-31 20:10:05 UTC
Permalink
jmcbee is right. I would test every value for it's range and replace it with NaN if it's in the wrong range.Ton
Tobin
2008-07-31 22:10:08 UTC
Permalink
Ton,
I've made an example based on your description. Here it is for reference.


3 color plot.PNG:
http://forums.ni.com/attachments/ni/170/345713/1/3 color plot.PNG
Cory K
2008-08-01 17:10:05 UTC
Permalink
OK, i misunderstood what you said.I thought you meant to have 3 seperate graphs.
That looks like it will work great.Thanks for your help.
Cory K
2008-08-01 18:40:19 UTC
Permalink
Hey Tobin, do you think you could attach that file as a .vi instead of png.I am having a hard time seeing all of the things you did.
Thanks,Cory
Tobin
2008-08-04 12:40:19 UTC
Permalink
Cory,
 
Here it is in ver 8.5.
Sorry it took so long, I was out on Friday and I did not check back until this morning.
 
Tobin


3 color XY plot.vi:
http://forums.ni.com/attachments/ni/170/346287/1/3 color XY plot.vi
Cory K
2008-08-06 19:40:06 UTC
Permalink
Thanks, that was a lot of help.

Continue reading on narkive:
Loading...