LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent!!! Color changes in XY PLOT!

I have a set of ranges for a particular quantity(i have a numeric controller as input).

Ranges are somewhat like 0-5, 5-10,10-15... etc. I need to plot the quantity on XY PLOT, NOT XY GRAPH.

I want to plot it such that for different ranges, the color of the point plotted will change. Eg. for the range, 0-5, the point is plotted in green, for  range 10-15 it's plotted in red..etc.!

Can someone show me how to do that?

0 Kudos
Message 1 of 6
(2,846 Views)

@vasusri92 wrote:

 I need to plot the quantity on XY PLOT, NOT XY GRAPH.


What's the difference here??

 

I think you want an xy graph with several plots, one for each color. Simply split the data into multiple sets, one for each color range, and show as many plots as you have colors. Do you have some typical data? Do you want a simple scatter plot, showing only the points or do you also want a line interpolation between points? (in the second case, it will become slightly more complicated because of the color switchover in the line).

 

Alternatively, you could map your data into an intensity graph.

0 Kudos
Message 2 of 6
(2,834 Views)

When I said I want an XY plot, i meant  I am using a draw plot function, and not a xy graph control to plot the points. That can't be changed since it is linked to some other application, whose plot needs to change color.

My basic requirement is as follows.

I input a positive value. there are different ranges for the input, say 0-5,5-10,10-15..etc..I need a code to designate each such range whith a particular color. Now the code should be such that it tests the number which is input, decides which range it comes under, and the point on plot changes its color to the color designated to that range. 

0 Kudos
Message 3 of 6
(2,819 Views)

@vasusri92 wrote:

 I am using a draw plot function, ...


I am not familiar with a "draw plot" function. Can you explain what that function is? Maybe attach a simplified version of your code?

0 Kudos
Message 4 of 6
(2,816 Views)

Now i plan to add a numeric control input with requirements as stated above to this program.

0 Kudos
Message 5 of 6
(2,802 Views)

@vasusri92 wrote:

Now i plan to add a numeric control input with requirements as stated above to this program.


  • You never posted (above?) about the requirements of a numeric control.
  • Your VI contains several controls, which one?
  • All your subVIs are missing.
  • Please put reasonable defaults in all controls and make current values the default before saving. (All zeroes is not reasonable)
  • What is the point of the FOR loop around the message express VI?
  • What determines the loop rate of your VI? (Currently it spins millions of times per second, consuming all available CPU). Use an event structure or place a wait primitive.
  • You don't need to write to the scroll properties millions of times per second. Once outside the loop is enough.
  • Convert all your hidden controls to diagram constants (or delete them completely if default values are sufficient).

Why not just draw circles using low level image commands? Mapping data to pixels is simple math!

 

... and why is this "Urgent!!!".

0 Kudos
Message 6 of 6
(2,770 Views)