How to draw the following 3D Matlab plot/graph? - plot

I am working on a data analytics project as part of my result.
I have cleaned and sorted my data as I wanted.
I want to show the data as shown in the figure below.
I have multiple files.
Each file represents a single day and the date in each file is hour and activity (as shown in the picture).
I am working in Matlab, I know how to do the 3D graphs. I also know about the ribbon function in Matlab.
But I can't exactly figure out how to draw the following graph. Any assistance will be highly appreciated. Thank you.

If you still haven't solved the issues, you can use ribbon plot in matlab. Please find the details in the following link.
https://www.mathworks.com/help/matlab/ref/ribbon.html
For example, if X is the vector containing all the data, then you can simply write.
ribbon(X(:,1));

Related

What type of data do I need for maplines in R highcharter?

I'm trying to add a mapline object to a highcharter graph (ideally using hcmap as a base)--in my case, so county borders can look different than state borders.
I've seen the solution listed here, but it doesn't work for me--indeed, running the answer's example code fails to create different lines for states and counties. Meanwhile, the more complex code shown here does work, but I'm not sure what it's doing under the hood, or how I could use its method to create a mapline object of state boundaries. What kind of data do I need to add a working "mapline" series? Does anyone know a good source for one for state boundaries?
Any help would be appreciated!

How to plot the data I read from a file in R?

Our instructor assigned us with typing a R script. We don't have any study paper or source for the codes that the instructor typed on class so I'm trying to get help from the articles on internet but I still couldn't find a guide for what I need. Please don't get me wrong, I don't request for someone to do my homework I'm just looking for some tips or any guide links that can help me. When I search on google, not all of the results are related to this and they are usually not helping me or too complicated. The assignment is:
Read data from a .txt file. (I researched and learned how to read data but my problem is I don't know which type of data should I type on the text file to make it plottable by average, standart deviation, histogram etc.)
On the first screen, plot the data, plot the average and plot the standart deviation as line
on the second screen, plot a line from corner to corner and sort the values on it
third screen, plot the data as histogram and plot the distribution function on it
4th screen, plot the anomaly and anomaly line = 0, then make the values that are higher than the anomaly line with different pch than the ones that is lower
finally get the png of 4 screens (i found how to do this)
Thanks.
Which type of data?
You should use metric data. For example the height/age of pople.
For example let's assuhe you have a dataframe yourDataframe:
height
160
155
176
153
185
On the first screen, plot the data
You can use R's standard plot function there: lines(yourDataframe$height)
plot the average and plot the standart deviation
There are already function for those things (for example mean(yourDataframe$height)). Just ask Google.
You can add those values to your linechart using points(mean(yourDataframe$height)).
I think after you did this you will be able to solve the rest of your assignment by yourself. R has quite a big community and you will find everything you need by googling. I guess this is how most people learn R.

R/Knime: plotting multiple curves in a single plot using a R snippet inside a KNIME loop

I'm new to both knime and R so sorry if my question is a bit silly.
I've created a simple workflow to:
1) open multiple file and join them togheter with only one x axis (PPM) and several y axis (the name is created through the cycle from the file location)
2)plot each indivual x and y couple and save them to a specific folder (with a R snippet)
3)plot all the curve in a single plot (with a R snippet) with different line style
The last point unfortunately is not working and I don't know why.
Here is the link to Gdrive with the workflow and some data
https://drive.google.com/file/d/0B6XSS-i7eUt7SlRVOWZ2RElKa0k/edit?usp=sharing
Any help (and suggestion to improve the code) will be appreciated :)
Cheers,
Michele

SVGAnnotation to create tool tips for each value in R heatmaps

I'd like to create a heat map in R that I want to use on a website. I stumbled upon the SVGAnnotation package which seems to be very nice to process SVG graphics in R to make them more interactive. First, I was planning to add tool tips for each cell in the heatmap - if the user hovers over the cell, the value of this cell should pop up. However, I am fighting with SVGAnnotation for more than 3 hours now, reading and trying things, and I can't get it to work.
I would appreciate any help on the SVGAnnotation tool tip function. But I would also very much appreciate alternatives to SVGAnnotation to add some activity to my R SVG heatmap.
So, what I have got so far looks like this:
library(SVGAnnotation)
data(mtcars)
cars <- as.matrix(mtcars)
map <- svgPlot(heatmap(cars))
addToolTips(map, ...) # problem
saveXML(map, "cars.svg")
My problem is the addToolTips function itself, I guess. Intuitively, I would simply insert the data matrix, i.e., cars, but this does not work and R gets stuck (it's calculating, but doesn't return anything, I waited 50 minutes)
EDIT:
After some more online research, I found a good example of what I want to achieve: http://online.wsj.com/article/SB125993225142676615.html#articleTabs=interactive
This heat map looks really great, and the interactive features (tool tips) work very well. I am wondering how they did that. To me, it looks like the graphic was done in R using the ggplot package.
I wrote a command line tool that can do exactly that if you are still interested to add tool tips to your heat map. It runs in Windows/Linux/MacOS terminals. All you need as input is the heat map as svg file and the data table/matrix that you used as input to create your heat map as csv or other text file.

How to plot a set of densities in 3D using R?

I need to plot, in 3D, a set of densities associated to a time series. More precisely, I would like to be able in R to build an image close to this example
This image is taken from [1]. The transparency plays an important role as let us see the trajectory of the "measures" in the x-y plane.
Any help will be greatly appreciated.
[1]: Juban and Kariniotakis, "Uncertainty Estimation of Wind Power Forecasts", presentation at EWEC 2008 - 01 April - Brussels, Belgium. (I can't post the link, google will help interested readers).
In 1996 I wrote a paper (published in JCGS) with a figure very similar to that but without the transparency. See http://robjhyndman.com/papers/estimating-and-visualizing-conditional-densities/ for the details. The plotting function is implemented in the R package hdrcde available on CRAN. The package contains some examples in the help files. You should be able to adapt my code to add the transparency.
This is how far I got thanks to Rob's hint. I used persp() to create an empty plot and added polygons and lines to it:
However, it is not as pretty as the original one... :(

Resources