C Programming. Plotting/Visualizing. Seeking recommended direction(s)  - Page 1
Forum section: electronics / beginners

author: renzoms
author_rank: Regular Contributor
timestamp: March 23, 2020, 04:59:43 pm
content: I'm working with pointers to pointers and structures, so I know some C programming. I don't know anything about other languages. I want to visualize/plot some code/graphs, for example, my A* algorithm, and Charging and Discharging Equations for Capacitors and the Voltage and Current of Inductors, developing my programs and skills and electrical engineering projects.I did some searching and was not excited by what I saw (Xlib and gnu), although I saw a .java visualization of A* and it was pretty. Again, I don't know anything about other languages. I wonder if I could link my C code to a .java code. So that's what I am interested in.Please let me know anything you know. Thanks.

author: TK
author_rank: Super Contributor
timestamp: March 23, 2020, 05:03:03 pm
content: You don't need to include the plotting/graphing logic in your program. You can just generate raw data and use external plotting/graphing tools or use python + pandas with the generated data.

author: renzoms
author_rank: Regular Contributor
timestamp: March 23, 2020, 05:23:22 pm
content: Is python + pandas your recommended external plotting/graphing tool? Would you recommend any other tools? Thanks.

author: engrguy42
author_rank: Frequent Contributor
timestamp: March 23, 2020, 05:25:41 pm
content: Have you considered C#? Really, if you're doing any UI stuff and graphing I think it's far easier to use C# for that part if possible.Here's video showing how to do a graphing app which also does an FFT in C#. Windows Forms even has a built-in charting library. And you can use the free MathNet libraries for all kinds of math analysis. Cool stuff.There's a couple more videos in that playlist dealing with data acquisition and stuff.

author: renzoms
author_rank: Regular Contributor
timestamp: March 23, 2020, 05:27:56 pm
content: Thank you.

author: atmfjstc
author_rank: Regular Contributor
timestamp: March 23, 2020, 05:28:58 pm
content: Generating external data for another program will work for some applications (e.g. plotting equations). If you save to a .CSV or .TSV you can just open them in Excel or OpenOffice and plot them there.For more interactive displays, well, C/C++ isn't the easiest language to use in this case, but you can look into the SDL libraries (https://www.libsdl.org/). You can get quickly started on drawing lines, points, shapes etc. Though of course you'll have to program all the coordinate/scaling/animation logic yourself.

author: TK
author_rank: Super Contributor
timestamp: March 23, 2020, 05:39:12 pm
content: Quote from: renzoms on March 23, 2020, 05:23:22 pmgnuplot

author: rstofer
author_rank: Super Contributor
timestamp: March 23, 2020, 05:49:07 pm
content: MATLAB is the definitive tool for math including plotting but even the Personal License costs a bit of money. Octave is a free work-alike.Here is a little program for logistics growth of population. It's just a sample of plotting a function and it works perfectly in both MATLAB and OctaveCode:n0 = 100;% initial populationk = 1000;% limiting populationr = 0.0205;% growth ratet = [0:0.1:500];N = (n0 * k) ./ ((k - n0)*exp(-r * t) + n0);plot (t,N)axis([0 500 0 1000])grid ontitle("Logistics Equation")xlabel("Years")ylabel("Population")text(200,700,"Initial Population n0 = 100");text(200,650,"Limiting Population k = 1000");text(200,600,"Growth Rate r = 0.0205");text(200,500,"N(t) = (n0*k) / ((k-n0)*e^{-r*t}+n0)")figure(gcf) % or shg command - pull plot to topAttached is the plot...

author: renzoms
author_rank: Regular Contributor
timestamp: March 23, 2020, 05:54:25 pm
content: Awesome reply, especially because I'm interested in MATLAB. Can you make interactive interfaces with matlab, such as selecting capacitor/inductor and entering ESR, etc? I'm concerned with having an expectation that I can make interactive programs on matlab. All I know is you can make pretty graphs in matlab.

author: renzoms
author_rank: Regular Contributor
timestamp: March 23, 2020, 05:59:07 pm
content: Thanks for addressing external data, and interactive displays with C. I am interested in interactive displays for Arduino and fpga projects like games, robots, and things related to electrical circuit schematics to become more involved in EE. Do you have a definitive recommendation or two for a direction to look into?

author: engrguy42
author_rank: Frequent Contributor
timestamp: March 23, 2020, 06:00:52 pm
content: Just be careful with Matlab...it's like a drugYou get the base software ($150 or something), and then find something you need to do isn't included. So you buy another library ($45). Then you find it's got that awesome Simulink. Another $45. Then you find it has the Digital Signal Processing stuff. $45. Control Systems. Parallel Processing. Image Processing....ARRGGGHHH. Those guys are truly experts in figuring out exactly what features to leave out so you'll run up against a brick wall and have to run to their website and spend more money.And soon you're like me...what started as a reasonably priced app suddenly became over $1,000 or so.

author: engrguy42
author_rank: Frequent Contributor
timestamp: March 23, 2020, 06:26:57 pm
content: BTW, forgot to mention...Don't forget that MATLAB uses their own language, so you have to learn that language to program stuff. And it's different. It's not like you can pull code from another language and run it.And as the name implies, it's all about MAT-rices. You define everything as a matrix, even when you don't need a matrix.Personally, I rarely use it anymore because I always get so frustrated. Either my support has run out and I have to re-pay to upgrade the feature, or I forgot the language and have to re-remember it, or the matrix stuff is so annoying, or I spend so much time figuring out which "toolbox" has the feature I need, and so on.Just be prepared before you jump in, and make sure you know exactly what toolboxes you'll need for the stuff you're doing, and you have the $$ to pay for it.

author: engrguy42
author_rank: Frequent Contributor
timestamp: March 23, 2020, 06:37:31 pm
content: Oh yeah, one more thing...and this is a biggie...Don't forget it's not like you have with C where you can make an executable and run on any platform. MATLAB doesn't do that. You need MATLAB to run your applications.There may be yet another "toolbox" that might allow you to do that (fuzzy memory....I think I looked into it long ago), but finally gave up on that since it was way too frustrating.Infinitely nicer, IMO, if you can start up Visual Studio for free, use free math libraries, make any interface you want (MATLAB requires yet another library (ie, more $$) for UI stuff like sliders and dials, etc.), drag n' drop UI graphs and controls, and it's all transportable, and you can integrate other people's Github code/libraries, etc....

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 23, 2020, 07:31:32 pm
content: Quote from: renzoms on March 23, 2020, 04:59:43 pmFor graphs (directed or undirected), I output the structure in Graphviz Dot language. I recommend you look at theexamplesand their sources first, then look at thedocumentationfor details. It is a really simple format where you simply describe the nodes and the edges (arrows) between nodes, in an arbitrary order.As an example, this is the description of a 7-node perfect binary search tree:Code:digraph {"4" -> "2";"4" -> "6";"2" -> "1";"2" -> "3";"6" -> "5";"6" -> "7";}To generate an SVG image, when you have a command that produces such description as output, just run e.g.dot -Tsvg > graph.svg. The different layout engines (dot,neato,twopi,circo, andfdp) lay out the graph differently. As you can see from theexamples, it is very simple to create structured nodes and direct edges to specific subnodes within a structured node.For visualizing numerical results and equation fitting, I mostly use Gnuplot. For more complex generated diagrams, my tools output SVG files directly.Note that Gnuplot can do arbitrary single-variable function fitting via the nonlinear Marquardt-Levenberg algorithm trivially.As an example, let's say your program outputs a number of values computed for a single-variable function, one point per output line (i.e., "xf(x)"). If these are in unspecified order, I'll sort the output usingsort -bgbefore redirecting to a file, say "out.txt". If I want to fit say a cubic function to that data, all I need to do is to start Gnuplot, and then tell itCode:f(x) = C3*x**3 + C2*x**2 + C1*x + C0fit f(x) "out.txt" using 1:2 via C0,C1,C2,C3fdef = sprintf("%g x^3 %+g x^2 %+g x %+g", C3, C2, C1, C0)# set term svg size 2048,1024# set output "plot.svg"plot "out.txt" using 1:2 title "Numeric" with linespoints, f(x) title fdef with lines lc -1and I'll get a curve of both the fit and the numeric data. The lines beginning with a # are comments; if you remove the # characters, the plot will be saved to an SVG file named "plot.svg", that you can edit in Inkscape afterwards. (All elements are initially multiply grouped, so just select all and ungroup, to make stuff easier to modify.) SeeGnuplot documentationfor more details.Personally, I tend to use Inkscape to convert all text to vector graphics. While it increases the file size by quite a bit (relatively speaking; the files are still tiny compared to JPEG or PNG image files), it ensures exact reproduction.(For the actual programs, I tend to use POSIX C, or Python 3 for examples.)Scientific publications in my field prefer LaTeX with figures as PostScript. After finessing the graph in Inkscape, the figures are trivial to export as or convert to PostScript. (If they don't need any fine tuning, you can just export the Gnuplot plot as PostScript.)Because I useMakefile-based automation in my projects, I usually have separate targets (recipes) for regenerating the data, redrawing the plots (usually in scripts or batch files), with the default target redoing everything from scratch (so thatmakeandmake clean alldo the same thing). I am lazy, so this is what I have found to be the most efficient way to do this stuff for me, and researchers I've helped with this kind of thing seem to agree this work really nicely. Then again, we all tend to use Linux, not Windows.If you have real interest, I could whip up an actual numerical calculation, sayMonte Carlo integration(it's the easiest I can think of), with example Makefiles, for you to run in Linux, to see how this all knits together.

author: engrguy42
author_rank: Frequent Contributor
timestamp: March 23, 2020, 07:34:18 pm
content: BTW, if you're interested in comparing MATLAB to C# here's a video from a few years ago that does just that.

author: rstofer
author_rank: Super Contributor
timestamp: March 23, 2020, 09:19:18 pm
content: Almost everything you can do with MATLAB can be done with the free work-alike Octave. There are other tools such as wxMaxima that do the math and plots and my personal choice for numeric programming is still Fortran but I would need GNUplot for the output. This wouldn't be interactive.Of course you can do interactive apps with MATLAB (and probably Octave) but I have never done it in any context other than Simulink where I had knobs and dials for variable input values. In this case I was just creating an analog computer solution to a second order differential equation.Google is your friend...

author: renzoms
author_rank: Regular Contributor
timestamp: March 23, 2020, 09:28:10 pm
content: Awesome creation. I'm excited about MATLAB, now.

author: rstofer
author_rank: Super Contributor
timestamp: March 23, 2020, 09:33:06 pm
content: When thinking in terms of 'interactive' connecting MATLAB to an Arduino is pretty much the ultimate in interactive. That toolbox is free, BTW.Of course everything in MATLAB is a matrix: MATrix LABratoryIt also does cool stuff like solving 6 equations in 6 unknowns:Code:% A football stadium has a capacity of 100,000 attendees% Ticket prices:% Student = $25% Alumni = $40% Faculty = $60% Public = $70% Veterans = $32% Guests = $ 0% A full capacity game netted $4,987,000% Let S = number of students, A = number of alumni, F = number of faculty% P = number of public, V = number of veterans, G = number of guests% S A F P V G = valueM = [ 1 1 1 1 1 1 100000; ... % total number of attendees25 40 60 70 32 0 4897000; ... % total revenue0 1 -1 0 0 0 11000; ... % 11000 more alumni than faculty0 1 0 1 -10 0 0; ... % public + alumni = 10 * veterans-1 1 1 0 0 0 0; ... % alumni + faculty = students1 0 1 0 -4 -4 0]; % faculty + students = 4 (guests + veterans)A = M(:,1:6); % extract 6x6 matrixB = M(:,7); % extract value column vectorP = M(2,1:6); % ticket price by attendee typeR = inv(A)*B; % compute number of attendees by typeT = sum(R); % check total attendees = 100,000 CHECKU = P*R; % total revenue = 4,897,000 CHECKV = R'.*P; % revenue by attendee type - transpose R from 6x1 to 1x6% then do element by element multiplication%% fancy output, all previous default output semicoloned%label = {'Students' 'Alumni' 'Faculty' 'Public' 'Veterans' 'Guests'};for i = 1:6fprintf('%-8s%7d @ %2d = %7d\n',string(label(i)),...round(R(i)),...M(2,i),...round(V(i)))endfprintf('\nTotals %6d %8d\n',round(T), round(U))Code:Students 25000 @ 25 = 625000Alumni 18000 @ 40 = 720000Faculty 7000 @ 60 = 420000Public 42000 @ 70 = 2940000Veterans 6000 @ 32 = 192000Guests 2000 @ 0 = 0Totals 100000 4897000I really wish I would have had this when I was in college. These days I just use it to keep up with my grandson's ME program. Statics is a course where it is really helpful and, of course, Kirhhoff's Law is easily solved.

author: rstofer
author_rank: Super Contributor
timestamp: March 23, 2020, 09:38:39 pm
content: Quote from: renzoms on March 23, 2020, 09:28:10 pmPlus the Simulink toolbox if you want to do that last example.Try Octave first and see if it has what you need. There is a bit of awkwardness getting it to load the toolboxes (Google for this) whereas MATLAB seems to do it by automagic. There is no Simulink equivalent if that becomes necessary but Google for 'octave simulink equivalent' and see if it gets you anywhere.Octave is a class act. It isn't MATLAB but it's darn close!See if there is a way to wrangle the Student License. At my grandson's university, MATLAB is a required course in the Engineering programs. What a magnificent way to get the students started plus it removes the drudgery from circuits and statics where the solutions are always more than 3x3 and often include complex numbers.

author: eliocor
author_rank: Unknown
timestamp: March 24, 2020, 02:15:09 am
content: Maybe you can use the freeDPlot JRDLLQuote

author: 5af734377e
author_rank: Newbie
timestamp: March 26, 2020, 03:33:16 pm
content: You can try soldering a wire directly to the output pin of the sensor, and measure the output voltage that goes to the comparator. This gives you a much better understanding than just seeing the output of the comparatorKodiLucky Patchernoxturn on or off.

author: Karel
author_rank: Super Contributor
timestamp: March 26, 2020, 04:31:51 pm
content: Another option is to use the free EDFbrowser to visualize your data, it has a ton of options and it's very fast and lightweight.https://www.teuniz.net/edfbrowser/

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 26, 2020, 11:55:52 pm
content: There is a reason (beyondUnix philosophy) why you should always consider separating visualization from computation: efficiency andmodularity.If the data generation takes considerable amount of time -- noting that I'm not talking about just the computation, but all the overheads including I/O and human interaction required --, then it is better to generate it only once, but allow it to be visualized using different tools.It also means that if you discover a new way to visualize or sonify your generated data, you do not need to modify the existing program (possibly introducing new bugs, and in any case making it more complex than it already is); you just create and use a different data visualization tool.Even if you do prefer to use a library (instead of command-line tools), do consider separating the visualization into a separate program for the above reasons. It is easier to maintain two simple programs than one complex one -- noting that it does shift a bit of the effort from programming into documentation: in the long term, it is important that the data file format/syntax is documented, so that one does not need to reverse-engineer from the generating program every time a change in an existing visualization program or a new visualization program is worked on.

author: Devil1267
author_rank: Newbie
timestamp: June 20, 2020, 04:53:47 am
content: Yeah i experienced content marketing is very effective ☝🏻cut the rope 2 mod apk

author: lunar
author_rank: Contributor
timestamp: June 20, 2020, 04:34:32 pm
content: I can't offer any sage advice on what is the best option, but I've built a quick plotting program using a combination of c, bash, and octave. Data is loaded into a postgres db. It's runs on a bbb. I've attached my project, though it's a WIP. I'll try to update this post when I have something formal to show.At the moment, C is only used to read sysfs (in Linux). If I wanted to optimize this code, I could incorporate the postgres and plotting in c. There's a gnuplot c library, which should be similar to what octave uses. I haven't bothered optimizing it as of yet though, as the goal was to get something that just works, out the door.Note: I made everything a .txt extension to please the forum, but the files are actually different extensions. (dbmake is sql, makefile has no ext, loadvar is bash, octave8 is a .m for octave/matlab, and the readadc is c.). If anyone is interested in using this, see the install docs, and plan to have an hour or so for figuring out what took me much longer. Below is an example of the plot input. Next step is to get a more stable ADC than the bbb's.

author: rstofer
author_rank: Super Contributor
timestamp: June 20, 2020, 05:02:07 pm
content: I have recently gotten involved with Applied Mathematics as a result of my grandson changing majors. They will focus on two tools:Python with its various libraries andR and RStudio for statistics.Attached is an example from the text: "Data Science Using Python and R" by Larose and Larosehttps://www.amazon.com/gp/product/1119526817The script is over on the left, the print output is on the right, underneath the graph.There is nothing interactive about it but I must say, the libraries for Python are terrific. And it's free...And that is a very expensive book. Expensive but worth every dime!Writing something in C# wouldn't be my first choice for visualization although buttons, knobs and dials should be fairly easy. I'm firmly of the opinion that MATLAB or Octave is the way to go. For knobs and dials, MATLAB/Simulink or even MATLAB/Arduino. I can set up a physical model with real knobs and real output and drive it from the Arduino. I haven't done it but I suspect it would be possible to use MATLAB inside a control loop and tweak the settings in real time.

author: wizard69
author_rank: Super Contributor
timestamp: June 20, 2020, 08:52:00 pm
content: The easy way to visualize data is to write the data to a file and plot it with a good plotting program. I can't remember the lat one I used but it was just a plot from a scope download that could be saved as a JPeg to include in some mail. Since plotting programs can often be had for free, everybody should have one of more installed.If you are into C++ then what you probably should look into is ROOT:https://root.cern.ch/. This huge package and has visualization elements in it. There is plenty of documentation, some of it CERN specific, but enough to get you started. This is probably not the best place to go if you want a quick graph of some static data.One option I never have actually used is VTK:https://vtk.org/about/#overview. Seems to be popular though.The last bit of programming I did was via Python with Matplotlib: (https://matplotlib.org) in Jupyter. That is actually an interesting way to program and has a pleasant ease of use. What I was plotting was Archimedean spirals, to learn Matplotlib and Jupyter; code of which I promptly lost due to a self inflicted error. If you are conversant in Python (who isn't) Python and Matplotlib might be a good solution. Jupyter has a nice that might not work for you but it could be worth looking into. The good thing is neither matplolib nor Python actually need Jupyter.In the past I've tired Excel and it frankly sucked for what I was trying to accomplish. Spreadsheets in general don't seem to understand plotting outside of the financial world.You indicate that you only know C++, this might be a good time to explore Python and the world of scripting. Python and matplotlib can be extremely powerful, and quick to use. I can't say I'm an expert but it is hard to beat Python for quick correct programs. If I was to suggest a package to anybody with modest needs it would be to go matplotlib and Python. By the way matplotlib is not the only Python way to turn data into charts or graphs.Quote from: renzoms on March 23, 2020, 04:59:43 pm

author: RenThraysk
author_rank: Regular Contributor
timestamp: June 20, 2020, 10:49:34 pm
content: If wanting interactive visualisations then might want to consider javascript.In particularMike Bostock's D3.Gallery of examplesSome of the algorithms visualizations are impressive/Visualizing Algorithms

author: rstofer
author_rank: Super Contributor
timestamp: June 20, 2020, 11:16:21 pm
content: I'm pretty confident with MATLAB but wxMaxima is another package that is free. Again, it won't support interactive control.Attached is a plot and the Fortran source to create it just as I did plots back in the early '70s on an IBM 1130 with CalComp drum plotter. It is tedious!But, for a young fellow working through college, I was one of the only students with unlimited access to a real computer.I did this as an example for my grandson when he took Algebra a few years ago. I have an FPGA version of the IBM1130 which runs all of the factory code unchanged. The Fortran to create the plot is mine and it uses the plotter library provided by IBM.If I wasn't in a hurry, I would use this approach for just about all of my plotting needs. Retro is cool! Not recommended if productivity is a factor but cool nevertheless.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 21, 2020, 02:37:05 am
content: One reason why I love to useGraphvizandGnuplotas external plotters, is that they support a huge number of different output formats – including PS, EPS, PDF, and SVG, the most important vector formats. (You might be surprised to see SVG in that list, but being able to get a publication-quality output in SVG format, then edit/finesse it in Inkscape, and finally save as a rather small EPS/PDF, is actually a known-reliable, known-good-output workflow.)In case you think gnuplot produces crude or ugly output, take a look at theexamples.When you want your program to generate the graphs, it is best to save the output to a file with a fixed name, and put the gnuplot script needed to generate the desired graphs in a separate file, and in the C program, just runsystem("gnuplot < script.gp")to have gnuplot generate the corresponding files. That way, you can finesse the plots without having to recompile your program.Generally, I use a Makefile to organize my projects. I makeallthe default target (by defining it very first), and it'llclean,build,run, andplotthe data. The plotting part runs gnuplot either directly (redirecting input from a script), or via a shell script (if it generates a large number of plots).During development, it is useful to run gnuplot (it then acts like a shell of a sort). The plot window is then interactive, and you can zoom into details (and rotate 3D plots). You can run scripts from the gnuplot "shell" using theload "script"command. Also, gnuplot supports quite complex functions and least squares fitting of univariate data to arbitrary functions, making it way more than just a plotting toolkit.

author: gcewing
author_rank: Regular Contributor
timestamp: June 21, 2020, 05:41:53 am
content: Another possibility is the Geogebra Graphing Calculator:https://www.geogebra.org/graphingYou can use it to set up interactive graphs with input sliders. Free and multi-platform. Browser and offline versions are available.

author: rstofer
author_rank: Super Contributor
timestamp: June 21, 2020, 03:43:50 pm
content: It is my understanding that wxMaxima is the solver of choice at CERN. In any event, they are deeply involved with the design and implementation.Here is a simple RC charging program and plot. Note the call to gnuplot!Code:(%i7)R:6.8*10^3$ /* 6.8k resistor */C:10*10^-6$ /* 10 microfarad capacitor */Tau:R*C; /* time constant Tau=R*C */SixTau:6*Tau;Vapplied:100$ /* applied voltage is 100 to make% scale on graph *//* equation for Vout(t) */Vout(t):=Vapplied*(1-%e^(-(t/Tau)))$t(tau):= tau * Tau$ /* graph x axis is in units of Tauconvert to units of t for calculation */(Tau)0.068(SixTau)0.408(%i8)plot2d([Vout(t(x))], [x,0,6], [y,0,Vapplied],[xlabel,"Tau" ],[ylabel,"% Charge"],[gnuplot_postamble, "set grid;set title 'Capacitor Voltage';"])$

author: orolo
author_rank: Frequent Contributor
timestamp: June 21, 2020, 04:44:35 pm
content: Lots of good suggestions in the thread.I've been through quite a lot of iterations: BASIC in high school; FORTRAN-77 and Mathematica in college; C & gnupplot, tikz & LaTeX (with some batch processing), maxima, maple and Python afterwards. All of them could work, but IMO some of them are more productive than others.I wouldn't use C for general scientific computing. Too low level, and memory allocation and pointers make things difficult. You need to be a competent C programmer (most people aren't, me included) to write good numerical C. I think the mess with the Imperial College pandemic code is a recent and illustrative example. I've seen things like that before, e.g. choosing bisection as equation solving algorithm because the programmer couldn't, for the life of him, implement Newton-Raphson without random crashes or inconsistent output. Yes, there are good numerical libraries available in C, but that takes us to the next point.I currently use Python +Numpy+Scipy+Matplotlibwhen I need numerical work done. Just install Python and then install these libraries following the instructions in the webpages (typically, use pip from the command line). There are also portable scientific pythons ready for download, with all the packages bundled.Python works well. For example, a couple of weeks ago I wanted to do a quick check on period doubling. I implemented theRössler attractorin a few minutes, just modifying an example for a simple dynamical system I found with a search engine. The result:Code:# Parámetros de Rössler.a = 0.2b = 0.2c = 5.7# Derivada.def model(v, t):xp = -v - vyp = v + a * vzp = b + v * (v - c)return [xp, yp, zp]# Construir solución completa:def flujo(v0, t):v = odeint(model, v0, t)x = np.zeros(len(v))y = np.zeros(len(v))z = np.zeros(len(v))for k in range(0, len(v)):x = vy = vz = vreturn [x, y, z]t = np.linspace(t0, t1, N) # tiempoa = 0.2s2 = flujo([-6,-2,0] , t)fig = plt.figure()ax = fig.gca(projection='3d')ax.plot(s2, s2, s2, label='a=0.2')ax.legend()plt.show()The output (can be freely rotated and magnified, and saved to disk):Note how theodeintcommand in Python uses a very customizable and high performance low level library to integrate the ODE. Python just does the gluing.I've also used Arduino + Python + serial interface + matplotlib to plot, in real time, the output of a 24-bit ADC. Here is a link to a youtuber who does something similar with arduino's 10- ADC:It's quite easy to do. Python also runs under window, linux and embedded systems, like raspberry pi and friends. You can mix matplotlib graphs and LaTeX if you want high quality formulas in your graphs.Another example: I've recently used Python to load a .wav sound file captured with a microphone, and analyzed its spectrum for a simple Doppler effect experiment. Just a few lines of code.And you don't need to be a Python wizard. I'm neither a competent python programmer.

author: rstofer
author_rank: Super Contributor
timestamp: June 21, 2020, 05:52:21 pm
content: Part of the criteria was 'interactive'. It seems to me that most of these methods could produce a family of curves whether written in Python, MATLAB, or any of the others. Just keep looping until the user gets bored.In the case where the program creates the dataset, it's really easy to plot a family of curves. It is only slightly more complex when the data is coming in from a file.Today, Python is probably the best way to go if the cost of MATLAB is an issue. Heck, for simple math, Python is probably the better solution. Integrating with Simulink is a separate issue and applies only to MATLAB.

author: wizard69
author_rank: Super Contributor
timestamp: June 21, 2020, 06:52:44 pm
content: One of the reasons I like Python is that with my sporadic programming I can come back to code written days ago or years ago and understand the program without spending a lot of time parsing the code. I even have a good chance of understanding somebody else code fairly quickly. With languages like C or C++ you can run into a lot of cryptic code that requires studying at best to understand. Of course that is often the fault of the guy that wrote the code.From my perspective, at this point in time, just about any engineer or technician should have Python in their tools set. I call it a tool because it basically is.

author: orolo
author_rank: Frequent Contributor
timestamp: June 21, 2020, 07:11:54 pm
content: Quote from: rstofer on June 21, 2020, 05:52:21 pmYou are right, I got a bit off-topic. Thank you.With respect to interactivity, you can integrate matplotlib into Tkinter, which is a de-facto standard multiplataform window environmet, quite easy to use.In this linkthere is a programmer who visualizes real-time bitcoin data with matplotlib+tkinter. Just as easily you can implement some sliders in your tkinter app, and update the matplotlib graph interactively. I've used tkinter rather often and it's easy; never needed to use it together with matplotlib, though.Another part of the criteria was easy interactivity with code already written in C. It's very easy to interface your own C code from Python,here is the link to the C FFI in Python 3.8. I've done this before, but some years ago (in the times of Python 2.6), and I remember it being easy.

author: nuclearcat
author_rank: Unknown
timestamp: June 21, 2020, 09:31:04 pm
content: Unlikely simple plain-C library exist, but for C++ there is some.Sure if it is possible to convert your project from C to C++.https://github.com/lferry007/LargeVisVTKhttps://lorensen.github.io/VTKExamples/site/Cxx/Also C++ header only library for mathlib plottinghttps://github.com/lava/matplotlib-cpp

author: ebclr
author_rank: Super Contributor
timestamp: June 22, 2020, 11:13:44 am
content: https://www.steema.com/product/vcl

author: Aman12011
author_rank: Newbie
timestamp: July 10, 2020, 04:25:35 am
content: update the matplotlib graph interactively. I've used tkinter rather often and it's easy; never needed to use it together with matplotlib, though.sad shayari