# Tag Info

41

I am not sure, if one can separate one curve out of the image. There is, however, another possibility to do what you want. It is possible to get the curve points out of the image. I am not sure, if I have already published here this answer. I checked but did not find it. Hence, I am publishing it. The task is fulfilled by a copyCurve function first described ...

27

In the comments mfvonh correctly points out that the Wikimapia's URL in my question is a user interface URL, not a tile server URL. The tile server link template is documented in a message which appears when one sends incorrect request to the tile server: From the above it is clear that the StringTemplate should be as follows: StringTemplate["http://i<*...

24

Mathematica can Import your file, and the result is a handy set of graphical primitives. So in this particular case we can do all the steps needed for data extraction without leaving Mathematica. I will not do the whole work for you but show the correct approach to the problem. First, you Import the file and check in what form the curves of interest are ...

23

There is a neat application called Tasker, which allows for the automation of scripts (tasks) on the android phone, triggered by events, time or phone state changes. In this example, we'll simulate the "It's just metadata" approach by capturing some phone variables and pushing the values into the new DataDrop Universal accumulator via the web api. ...

23

Here's a set of functions that allows to do this. The code uses many ideas found on this site and on other places on the web. It is a bit factorized already so it should be easily reusable. More on YQL and available tables here: https://developer.yahoo.com/yql https://github.com/yql Query test Edit: this API is great also and simple http://www.quandl.com/...

23

This small app allows you to select data points and put them in a bin. In that way you can manually select several curves. I imagine this might be useful to someone who has complex plots where lines might intersect, making it hard or impossible to extract the data programmatically. You first have to set the image at the first line. After that when you want ...

19

The graphics we want are on page 50, but there are six prefatory pages labelled i through vi. So we will start by loading page 56 into memory: $url = "http://ediss.sub.uni-hamburg.de/volltexte/2004/1133/pdf/dissertation.pdf";$page50 = Import[\$url, {"Pages", 56}] // First We used First because importing PDF "Pages" returns of list of pages, in this case ...

18

Doing this with basic image processing can be done. In comparison to the post you have linked, your situation is more complicated because you have a monochrome image with no option to separate colors. Additionally, your graph is surrounded by a frame. Let's assume we want to separate not the line but the area under or over the line that is inside the frame. ...

17

this code produces the three lists of data that you want orange,blue and green s = Import["https://i.stack.imgur.com/bR8Gg.gif"]; t = ImageData@s; h = Union@Flatten[t, 1]; p = FindClusters@h; F[x_] := (# - {20, 29}) {3/350, 3/100} & /@ Select[Flatten[PixelValuePositions[s, RGBColor[#]] & /@ p[[x]], 1], #[[1]] > 20 && #[[2]] > 29 &...

15

It never updates for me properly. This is what I do: ro = ResourceObject["Epidemic Data for Novel Coronavirus COVID-19"]; DeleteObject[ro]; ro = ResourceObject["Epidemic Data for Novel Coronavirus COVID-19"]; Just delete and re-download. Wolfram basically just provides some minor convenience by re-formatting the data to a more Mathematica-compatible ...

14

If this device support NI-VISA (as I understood from your reference to LabVIEW), then you can use following way: Install the VISA engine (available at National Instruments' web-site) Use the following code. Needs["NETLink"] lib = LoadCOMTypeLibrary[ "C:\\Program Files (x86)\\IVI \Foundation\\VISA\\VisaCom\\GlobMgr.dll"] mgr = NETNew["Ivi.Visa.Interop....

14

The airport utility on your mac (which is not very widely known) gives you programmatic access to all your wireless information. I wrote a fun answer on Ask Different using this command line utility. To get the information about wireless devices around you, use the -s flag. Here's a simple function to automate it: getSSID[] := With[{data = Import["!/System/...

14

Mathematica 10 has support for a serial device which greatly simplifies things. I am capturing byte data from an XBEE on a usb card being sent from an arduino with an XBEE transmitter. In Mathematica the only commands needed to plot 200 points on a Mac are... port = "/dev/tty.usbserial-DA00X00E" dev = DeviceOpen["Serial", {port, "BaudRate" -> 9600}] ...

12

I wrote code for data acquisition with the Adafruit 10-DOF sensor a while back. I will share that code, with explanation, so that you can adapt it yourself. Mathematica + Adafruit == TRUE It's awesome and easy to connect to an Arduino with Mathematica: Open a connection to Arduino and specify the paths to the Adafruit libraries (I put the library folders ...

12

Here's something to get you started down to path of scraping the somewhat larger individual pictures from the Nobel website: links = Import[ "https://www.nobelprize.org/nobel_prizes/physics/laureates/index.html?images=yes", "Hyperlinks"]; individualpagelinks = Select[ links, StringMatchQ[ "https://www.nobelprize.org/nobel_prizes/physics/...

12

After some mental hemming and hawing, I decided it'd be good to have a proper answer about importing HTML tables using something other than the often buggy "Data" field. So here's what I got. First something to pull all the "table" fields: getHTMLTables[url_String?(StringStartsQ[URLParse[#]["Scheme"], "http"] &)] := getHTMLTables[Import[url, {"...

10

I recently discovered SocketLink bundled with Mathematica. It's not documented, but super straightforward: << "SocketLink" port = 1234; s = CreateClientSocket["host", port] {inputStream, outputStream} = OpenSocketStreams[s]; This returns a binary InputStream and OutputStream that you can read/write like any other Mathematica stream with BinaryRead ...

10

You have misunderstood how this works. What happens is that JavaScript calls a server-side script which returns the data, and the data is subsequently inserted into the HTML. The data cannot be found in the HTML document (in the HTML or in the JavaScript) to begin with. The most straightforward way to get the data is to monitor the network and observe what ...

9

Since Mathematica 10 it's possible to pull data from Google Analytics using ServiceConnect and ServiceExecute. I refer you to the documentation for all the details, but here is a small sample. Establish a connection: ga = ServiceConnect["GoogleAnalytics"] Get the number of visitors and the number of sessions over the last ten days: req1 = ServiceExecute[...

9

Yes, it is possible to use the ellipsoidal Mercator projection by specifying an ellipsoidal "ReferenceModel" in the projection. To compare, let me define a spherical Mercator projection: In[1]:= webMercator = {"Mercator", "ReferenceModel" -> GeodesyData["ITRF00", "SemimajorAxis"]} Out[1]= {"Mercator", "ReferenceModel" -> Quantity[6.37814*10^6, "...

9

If the problem is only to remove the grid, that's relatively easy. You just remove everything but the grid, then take the difference. You can use Closing with a rectangular structuring element to remove everything but the horizontal / vertical grid lines, like this: img = Import["http://i.stack.imgur.com/TkvSR.png"]; hFilter = Closing[img, BoxMatrix[{...

8

Calling Wolfram|Alpha is not generally an efficient way to retrieve bulk data; where possible, it is better to use a built in data function. Part of the problem is figuring out what to submit to Wolfram|Alpha. In the code you supplied, the issue begins with Wolfram|Alpha returning Missing[NotAvailable]. WolframAlpha["AAPL history",{{"HistoryDaily:Close:...

8

Say, you get this with Import data = {{"#", " time", "nu=0.01", " nu=0.25", "nu=0.50", "nu=0.75", "nu=1.0", "phi(t)=exp<-t/2)"}, {0., 1., 1., 1., 1., 1., 1.}, {0.0019999999999999999, 0.999245, 0.999124, 0.999971, 0.999942, 0.999, 0.9995}, {0.0020000000000000000, 0.99873, 0.998292, 0.998104, 0.998049, 0.998002, 0.999}, ...

8

Your real problem is I have a large .txt file In a txt file, each number is represented by a sequence of bytes with possibly varying length followed by a newline. When you read it back in, the bytes representing the digits, the number-point and the newline need to be converted back to real numbers. This is time-consuming. On the other hand, in a binary ...

7

I just logged into Google Analytics and had a look at the export formats they offer. They offer many different formats that can be read by Mathematica: CSV, TSV and Excel are those that stand out as very easy to work with. Here is an example where I chart the number of visitors over a certain period of time: data = ImportString["Day Index,Visits 12/...

7

First I got the same error message. Using the menu bar Edit ► Preferences... and clicking the "Update Local Indices from Wolfram Research Server" button under the Internet Connectivity tab fixed this erroneous behavior.

7

You can actually start and control a web browser session from Mathematica using an experimental implementation for WebDriver, Since Mathematica 11.3. Look at this answer An example Module[ { session = StartExternalSession["WebDriver-Chrome"], iws, chromedo, img, links }, chromedo[cmd_] := ExternalEvaluate[session, cmd]; Pause[1]; iws = ...

7

In 11.3 you can do: ExternalEvaluate[session, "JavascriptExecute" -> "return document.documentElement.outerHTML;"] In 12.0 and up, the syntax has change a little bit: session = StartWebSession[]; WebExecute[session, "OpenWebPage" -> "https://weather.com/weather/tenday/l/New+York+NY+10017:4:US"] html = WebExecute[ session, "JavascriptExecute"...

6

I wrote this in the comment, but the code did not come out properly formatted. So here it is again: Import["https://en.wikipedia.org/wiki/Mathematica", "Images"]

6

img = ImageTrim[ Import["http://i.stack.imgur.com/MBL2d.png"] , {{30, 4}, {1910, 287}} ] Total[ImageData@ ColorNegate@ Binarize[ ColorSeparate[img][[3]]], 2] 142017 That is the number of pixels in the plot for download data. Vertical axis is 2.99404 KB/s/pixel. Horizontal axis is 1.27524 secs/pixel Total download 142017 (40 ...

Only top voted, non community-wiki answers of a minimum length are eligible