How to draw a dynamic line graph using json data? - json

So basically i'm trying to draw a multi line graph from the results of microsoft emotion api result data.
anger: 0.00108685507
contempt: 0.00179950753
disgust: 0.0000793820145
fear: 0.00272498373
happiness: 0.0000412895
neutral: 0.9678982
sadness: 0.0132255116
surprise: 0.0131443078
This is the result data.So what i want is to have a line drawn each time a result is obtained.And the line should be drawn from a combination of these results.Each line should be drawn from 4 points as the results have 8 fields which can be paired up into 4 points.

Related

MySQL ST_CONTAINS returns false for MULTIPOLYGON with more than 1 polygon

I have a bunch of locations (points) with coordinates stored as geometry points. I've imported spatial data of provinces in my country and I'm trying to determine the province in which each location lays, which worked for 26 of 28 provinces in total.
Before importing the data I noticed that all provinces had their geometries defined as POLYGON except the two in question that were defined as MULTIPOLYGON, so for consistency's sake I converted all to MULTIPOLYGON where the majority contain data for just 1 polygon.
I am testing now with one province which contains 3 polygon geometries in its MULTIPOLYGON definition. The point I'm testing with is contained within the third polygon, I have confirmed this by testing all 3 manually using the function found in this question:
Here's my SQL which returns 0 (on pastebin because SO won't let me post it here)
https://pastebin.com/raw/bkNeBgcL
If I remove the first two polygons, then it returns 1
https://pastebin.com/raw/UfTax1K5
If I'd had to guess what's going wrong is that mysql is expecting the point to be in all 3 polygons at the same time? And I need to tell it to return true if it is in any of the polygons inside the multi-polygon, but how?

Trying to contour a CSV file in QGIS

I have rainfall data which I have imported as a csv file. It's 185 lines like this:
Name, Longitude, Latitude, Elevation, TotalPrecipitation
BURLINGTON, -72.932, 41.794, 505, M
BAKERSVILLE, -73.008, 41.842, 686, 42.40
BARKHAMSTED, -72.964, 41.921, 710, M
NORFOLK 2 SW, -73.221, 41.973, 1340, 44.22
Looking at the layer properties the latitude and longitude are brought in as "double" but the rainfall amounts come in as "text" so I can't contour them.
How can I get beyond this point and where do I go to do the contouring? Do I go to Vector:Contour? Will it understand M is missing data or will the Ms still exist if this is converted to "double?"
I'm a little confused. Thanks for the help.
I think I might have the idea of help.
Since you have the sort of points located randomly across some area you could do as follows:
Load CSV to your QGIS in order to set the point layer with an attribute table including your most important value, which is Total Precipitation. Let's call it the TEST layer
Processing Toolbox -> TIN Interpolation -> Select the TEST layer. As an Interpolation attribute choose "Total precipitation". Use the green "+" symbol for adding this selection. Don't forget about the Extent option, where you could define the bounds of your interpolation. Preferably I wouldn't exceed the layer I am working on. Output raster size is also important - avoid a small number of rows. Put them about 10 optionally in order to make your interpolation efficient.
https://www.qgistutorials.com/en/docs/3/interpolating_point_data.html
Main bar -> Raster -> Extraction -> Contour
In the input layer select TEST, Interval contours between lines can be 10 (10mm in your case), Attribute name - put PRECIPITATION -> click Run
Your precipitation lines are ready! Now, you can Right-Click -> Properties -> Symbology (change color) or _>Labels (provide labels based on your attribute column Total Precipitation).

Getting a surface graph from a json file in gnuplot

I'm not a dev, I'm doing this for a school project. I'm trying to put the following dataset into a surface plot in windows gnuplot. qt type terminal, if that's important.
https://files.catbox.moe/nbc6l1.json
As you can see, it's a huge set of data. Pulled directly from an image and into a csv file, which I converted to json.
When I type in "splot 'C:\Users\tyler\ESRP Data\sampleOutput.json'", this is what I get.
As you can see, there's only a single line, when there should be something approaching an intensity chart in a 3 dimensional space. Is it a problem with the data? Do I need a specific command to do this?
It would help if you attached an example of your image data to the question, and also if you provided a link to a plot similar to the one you are trying to create. There are many different styles one might use to represent a surface. I will attempt to guess at a possible solution.
Input image (scribbled in GIMP and saved as a png image):
Gnuplot surface plot:
set border -1
unset tics
# surface represented by colored lines in 3D
# down-sample by 4x in each dimension to get an interpretable surface
set palette defined (0 "blue", 1 "white")
splot 'scribble.png' binary filetype=png every 4:4:4 using 1:2:3:3 with lines lc palette

How to use Gnuplot to create histogram from binned data from CSV file?

I have a CSV file which is generated by a process that outputs the data in pre-defined bins (say from -100 to +100 in steps of 10). So, each line looks somewhat like this:
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
i.e. 20 comma separated values, the first representing the frequency in the range -100 to -90, while the last represents the frequency between 90 to 100.
The problem is, Gnuplot seems to require the raw data for it to be able to generate a histogram, whereas I have only the frequency distribution. How do I proceed in this case? I'm looking for the simplest possible histogram, that perhaps displays the data using vertical bars.
You already have histogram data, so you mustn't use "set histogram".
Generate the x-values from the linenumbers, and do a simple boxplot
plot dataf using (($0-10)*10):$1 with boxes

How to do multiple boxplots with Octave?

I have 3 matrices that I would like to be plotted on a boxplot (two of them are 22 rows by 83 columns, and the other is 7 rows by 83 columns) within Octave.
I've tried:
boxplot([red(:,1),blue(:,1),purple(:,1)])
error: horizontal dimensions mismatch
error: evaluating argument list element number 1
But, I keep getting the above error. I assume it's because I have one matrix with 7 rows instead of 22? If so, is there any possible way of getting them both plotted on the same boxplot?
When you pass [a,b,c] you are trying to build a matrix by concatenating horizontally the other three. Since they do not have the same number of rows that will never work.
If you want to do the boxplot use cells (as indicated in help boxplot) that is
boxplot ({red(:,1),blue(:,1),purple(:,1)})