LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

drawing multiple lines on intensity graph

I want to draw multiple lines on intnsity graph, as shown in attachment.

But I need the lines to fill all the graph, while I only draw few lines in the attachment.

The attachment is my data and the lines on it are drew by photoshop.

the lines are on the shadow area which represent the lattice direction.

And this link is the question I asked before with very good resolution by Altenbach, which is easier than this one.

http://forums.ni.com/t5/LabVIEW/drawing-lines-on-intensity-graph/m-p/2450058/highlight/true#M752585

And my requests are

1.set line1's angle, then draw on the graph

2.set the distence between each line and the area where lines will cover on it.

3.set line2 with all the steps as line1

4.line3 and so on.

 

Is there anyone can help or give any suggestion?

0 Kudos
Message 1 of 14
(3,217 Views)

Once you know how to draw a line, drawing multiple lines is equally simple :D. Just use a loop! That's why we have computers!

 

What did you try so far?

Where exactly did you encounter any problems?

0 Kudos
Message 2 of 14
(3,213 Views)

I am trying to use a linear equation to set up these lines.

But I don't know how to control these lines within the area I want.

0 Kudos
Message 3 of 14
(3,184 Views)

I am trying to draw one line which I can set up the length and angle as before.

And my thought is to use the for loop to draw other lines by shifting one unit in y-direction.

I found there might be some problems by only shifting in y-direction when I draw the lines whose angle are between 90~180 degree.

I think the better way is to set the distence between each line, it will be more precise.

But I have no idea about that, because so far I am suffering from some bugs so that I can't test my example.

any help or suggestion?(attachment is my file.)

And I am sorry for some silly ways on my modfying your example.

0 Kudos
Message 4 of 14
(3,173 Views)

To define a line, all you need is two points. For each line, move to a starting point and draw a line. Use a FOR loop to repeat.

 

Here is a very rough draft. You need to add a little bit of math to adjust the needed number of loop iterations, etc. You also need to decide how to define the angles and hwere to start.

 

 

0 Kudos
Message 5 of 14
(3,163 Views)

I still have some questions about the example you gave me. please check the attachment.

1. in circle 1, I have no idea why you use (-2)^n to multiply by negate spacing, and what's the result for combining with the spacing angle?

2. in circle 2, why the result in circle1 add lines' value become the end point? the same questions goes to subtract part.

3. in circle 3, is the blue line represent the shifting of the spacing?

 

I hope I can figure out and gain well-understanding about this example after your explaining.

I really appreciate your kind. : )

0 Kudos
Message 6 of 14
(3,148 Views)

hey_yo wrote:

1. in circle 1, I have no idea why you use (-2)^n to multiply by negate spacing, and what's the result for combining with the spacing angle?


That's a x2^(-1), or a division by two. This has nothing to do with (-2)^n.


hey_yo wrote:

2. in circle 2, why the result in circle1 add lines' value become the end point? the same questions goes to subtract part.


To draw a line, you move the pen to the start point and draw a line to the end point.

We move a point (held in the shift register) perpendicular to the lines with an increment of the line spacing. For each of those points, we go an equal distance left and right and draw a line. Wire a smaller number (e.g. 5) to N of the FOR loop and see how things look.


hey_yo wrote:

3. in circle 3, is the blue line represent the shifting of the spacing?


Which blue line? We have the picture wire and the line color wire. Where do you see a blue line?

 

As I said, the current algorithm is relatively crude and we draw too many lines outside the visible area, just so the area is always coverend, no matter what the angle and linespacing is. That's why I said you should add a bit more intelligence so we only draw the line portions that are actually visible.

 

 

 

0 Kudos
Message 7 of 14
(3,129 Views)

oh~ sorry I didn't make the question clear.

In the question3 what I mean is the picture line.

and I found that I mistakenly took it as the value which is wired with the 2^(-1).

I still have some questions

 

why the minus value of the spacing shoud be divided by 2? and why it becomes the "r" value?(I mean in the circle1)

 

and I try some numbers for N of the loop.

why it should larger than 130 or it won't show any line no matter how large the x,y scale is?

(I try the range -10000~10000 for xy scale and get the same result) 

and is this phenomenon means I should control this number to confine the lines within the area I want?

0 Kudos
Message 8 of 14
(3,117 Views)

and I try some numbers for N of the loop.

why it should larger than 130 or it won't show any line no matter how large the x,y scale is?

(I try the range -10000~10000 for xy scale and get the same result) 

and is this phenomenon means I should control this number to confine the lines within the area I want?


 

and I found that if I change the angle from negative to positive, the result will totally different!!

so cool!

0 Kudos
Message 9 of 14
(3,111 Views)

I also try to draw other lines, although I haven't figure out the problem I asked.

And I found that my line1 can be changed with varying the value(e.g. angle, spacing) while line2 can not.

I am wondering how to make all the control to influence the result simultaneously?

0 Kudos
Message 10 of 14
(3,102 Views)