LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get smooth plot in graph

Solved!
Go to solution

hello all Smiley Happy

 

 please refer the attached file for my question.

 

in it u can see two plots. the left one is on excel and the right one on labview. both the plots are for same data.

u can see the difference

i want to generate a smooth curve like that on excel. 

i tried various curve fittings like  polynomial, exponential, spline but was not able to get the smooth plot like the one im getting in excel.

note that the number of points in my data are only 5

0 Kudos
Message 1 of 13
(7,101 Views)

@gargrahul wrote:

i tried various curve fittings like  polynomial, exponential, spline but was not able to get the smooth plot like the one im getting in excel.

note that the number of points in my data are only 5


Show us what you tried. You need to generate a much denser x-ramp, then use a spline interpolation.

0 Kudos
Message 2 of 13
(7,089 Views)

 i used the spline function directly

my data array has only five elments

refer the image to see the block diagram

0 Kudos
Message 3 of 13
(7,075 Views)

Please upload your VI and not a picture.

0 Kudos
Message 4 of 13
(7,032 Views)
Solution
Accepted by topic author gargrahul

Try this...

 

 

Download All
Message 5 of 13
(6,996 Views)

OMG !!

 

that worked

u really can do a lot with less coding Smiley Happy

sir ur block diagram blew my mind

 

im sorry i should have uploaded my vi earlier

im using labview 10 so can u upload the same vi in labview 10 or just tell me the spline function u used

actually i searced for that function and came across interpolation 1D

is this the same function that u have used ???

the other one u have used is ramp pattern ???

 

i have to study these functions now

 

0 Kudos
Message 6 of 13
(6,937 Views)

Yes, "interpolate 1D" and "ramp pattern". I am not sure if they are exactly the same in LabVIEW 2010 but here is the downconverted version.

0 Kudos
Message 7 of 13
(6,923 Views)

hello! Your this vi is working perfectly, but i have problem. I am plotting the xy graph real time, like my values of x and y are sensor values, when i am connecting that x y values with your code, it is not connecting and dotted lines showing. Please help that how can i make graph live with this smooth type curves?

0 Kudos
Message 8 of 13
(3,926 Views)

Hi Salman,

 

as has been said before in this thread: Attach your code! (Not just images of code, but real code.)

 

What have you tried? Where are you stuck? Which errors do you get?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(3,918 Views)

Hi,

 

 

I have attached the picture which i want to do actually. Basically in original solution the values are fixed between a maximum and minimum values and the values are stored in a arrays. But in my situation i am reading the live two temperature values from a sensor and these values are sending to labview from arduino properly. Now i want to plot these values in XY graph, for example T1 on x-axis and T2 on y-axis. XY graph is plotting properly but in sharp edges, i want these graph in smooth trend as show in this original post problem. So the basic difference in my case is i am reading the live values not stored in arrays. Now i want smooth graphs by not storing in any arrays, these should be live and curvy.

0 Kudos
Message 10 of 13
(3,906 Views)