Learning Curve of Wolfram Alpha or Matlab

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
17 replies · 2K views
DaveC426913
Gold Member
2025 Award
Messages
24,616
Reaction score
8,960
TL;DR
I'm always wanting to plot simple graphs, what are my options?
I should probably get one or two of these under my belt.

My current need is to plot a ... I guess it's a heat map.

I've got a map of my local area and I want to determine the geographical centre of a number of points (say, seven). So, for every xy "cell" on the map, I'll use pythagoras to determine the "as the crow flies" distance from each of the start points, add them up and give them a colour.

I'm hoping for something vaguely like this:
HoloviewsOutput.png

(I may be overengineering this - but I do like graphical renders. I'm sure there's a much more expedient way to find the centre of n points, using just geometry.)
 
Physics news on Phys.org
Cool. My go-to would be Dynamic HTML using Javascript such as jQuery. Maybe freemat will provide the infrastructure for me that I'd have to otherewise make.
 
*sigh*
What's the point in learning to do something if someone's already produced an app that does it with a click?

https://www.geomidpoint.com/

1639709790420.png

Really wanted to see that heat map tho... :sorry:
 
With conditional formatting in LibreOffice and two different color scales:

distances.png


distances2.png
Note: I scaled longitude with cos(43 degrees) to get a more realistic latitude/"longitude" distance ratio in the calculations but didn't pay too much attention to getting that right for the large table.
 
Writing code to compete with an existing app is still a lot of fun. One has to reverse engineer the algorithms used and then make your app more suited to what you want which in turn make it a better app worthy of becoming publicly available via Github.
 
DaveC426913 said:
Summary:: I'm always wanting to plot simple graphs, what are my options?
DaveC426913 said:
*sigh*
What's the point in learning to do something if someone's already produced an app that does it with a click?
Well, this very specific app will not give you any progress in the general goal of being able to plot simple graphs.
 
jedishrfu said:
Try freemat before you jump into get Matlab. It’s free and implements most of Matlab s core functionality For free. Free free free!

http://freemat.sourceforge.net/
Freemat seems not to be very active anymore? Why not use Octave instead? (Or indeed scipy, numpy, matplotlib from Python)
 
Huh. Well that wasn't nearly as painful as I thought. Took me all of 3 hours in Dynamic HTML and Vanilla JavaScript. Didn't need a library after all (only 44 lines of code).

This is rough and crude and I can add a lot of bells and whistles to it, including generalizing it to accept any number of "houses", but it is operating at full capacity.

1639857707959.png


It is, alas, as-the-crow-flies, so does not account for roads or speeds - just straight line-of-sight distance.

(Note: the point in the far east is actually two points - two people carpooling from the same location. This skews the centre a little east.)
 
Last edited:
  • Like
Likes   Reactions: mfb
DaveC426913 said:
Cool. My go-to would be Dynamic HTML using Javascript such as jQuery.
I see you have a solution, but for future use I recommend Plotly. It is not as comprehensive as Matlab or matplotlib, but it does do heat maps.

It is 2021, nobody uses the term 'Dynamic HTML' any more, or jQuery :-p
 
Last edited:
pbuk said:
It is 2021, nobody uses the term 'Dynamic HTML' any more, or jQuery :-p
Nobody uses vanilla JS anymore.
 
  • Like
Likes   Reactions: pbuk
DaveC426913 said:
Nobody uses vanilla JS anymore.
If I had a dollar for every hour I spent working on things that "nobody uses anymore", I would ...
Oh wait, I do. I made a whole career out of it. ;-)
 
  • Like
Likes   Reactions: suremarc and DaveC426913
FactChecker said:
If I had a dollar for every hour I spent working on things that "nobody uses anymore", I would ...
Oh wait, I do. I made a whole career out of it. ;-)
For my personal projects, I like self-contained solutions. I find they last longer before rotting.

I have some cool projects - one of which drew in 14,000 users and generated more than a million data points - but, because it relied on a database, the infrastructure rotted as I moved from web service to web service. And now it lies broken until I feel like refurbishing it.
 
  • Like
  • Love
Likes   Reactions: mfb, pbuk and FactChecker
FactChecker said:
If I had a dollar for every hour I spent working on things that "nobody uses anymore", I would ...
Oh wait, I do. I made a whole career out of it. ;-)

I would definitely ask for a raise if I were you 😂
 
  • Like
  • Haha
Likes   Reactions: suremarc, mfb and FactChecker
DaveC426913 said:
For my personal projects, I like self-contained solutions. I find they last longer before rotting.

I have some cool projects - one of which drew in 14,000 users and generated more than a million data points - but, because it relied on a database, the infrastructure rotted as I moved from web service to web service. And now it lies broken until I feel like refurbishing it.
Yes. That is one of the great pleasures of being able to select the language and tools that you want to use. It's fun instead of work.