LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drawing a pattern inside an XY Graph

Hello

 

I'm in a project where curves of Density for some mixed materials are plotted on an XY graph.

 

We are taking samples for different materials during numerous experiments and from a sensor attached to labview we get the desired data into arrays and then into the curves and I have abosolutely no problem with that.

 

In each cycle we mix various percentage of known materials (for example 20% Material 1 + 80% Material 2) and then we get results ,and then another cycle (50% Material 1+50% Material 3) and then we get results.

 

We have a legend containing colors (or patterns) representing each material ,and then we represent these percentage graphically on the X-Axis of the curves against the plotted data (but till now we do that manually by photo editing).

 

Is there any function of any kind in labview where I can programatically color or draw a pattern inside an XY graph on certain intervals?

 

I used my photoshop skills to make a photo of the expected result of what I'm looking for.

 

You can see in the photo for example from X=9 to X=10.5 I have a mixture of three materials (yellow ,green and red patterns) where the yellow is about 50% of the sample and the rest is distributed between the green and red pattern ,and then the percentages get different along the x-axis with different samples.

 

I know I may sound imaginary ,but this process when done manually is a very exhausting process on the user to draw it (after exporting an image from the XY Graph) ,so automating such process will be a great success for this vi.

 

I have no problem also to draw on another graph and then stack that side by side with the plotted curves ,I only want the x-axis values to match each other along the data being written

 

I'm open to any out of the box ideas.

 

Thanks in advance people.

0 Kudos
Message 1 of 7
(3,585 Views)

You can draw on any graph using the "plot images" property. This allows you to use all 2D picture control features.

 

(Some examples can be found in the links of this idea)

 

0 Kudos
Message 2 of 7
(3,573 Views)

The plot image property inserts an image in the plot area of the graph ,and I can see also in the examples in the link that there's some kind of a vi that can move the image (instead of the top left corner of the plot area) to any other place on the plot area.

 

However ,I need to actually tie the image to coordinates on the graph and not the plot area ,the graph updates in realtime with the data coming and the maximimum and minimum of the graph changes too ,so i need the image also to move with the data.

 

 

0 Kudos
Message 3 of 7
(3,563 Views)

There are methods to convert between xy values and coordinates. (details)

0 Kudos
Message 4 of 7
(3,559 Views)

Back to the original problem, you could just add a few more plots using fill options to create solid areas (e.g. fill to inf etc.). Do you really need patterns?

0 Kudos
Message 5 of 7
(3,555 Views)

No ,I think I may get things done with only filling ? how actually its done ??

0 Kudos
Message 6 of 7
(3,503 Views)

Thinking outside the box...

 

IN this thread post #38 I shared a screenshot ...

 

 

...where I showed that I could map a jpg to surface in a CW 3D graph. In my case I wanted to map the jpg to the actuall terain of a model train layout. In the case of this thread, that surface can be kept constant.

 

You should then add addtional line plots to the CW 3D graph to add to that graph.

 

The part that wouldbe useful is the ability to zoom and keep the image in the same scale as the graph.

 

I BELIEVE I included the source code (it has to be horendous since I was still a wee--Gee-babe back then) in LV 7.0 is so. I included some logic to translate the colors of the jpgs to CW colors.

 

Ben

 

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(3,447 Views)