visualdatatools.com Forum Index visualdatatools.com
Discussion for DataTank and DataGraph
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple stacked plots

 
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Feature Request
View previous topic :: View next topic  
Author Message
kji2080



Joined: 04 May 2009
Posts: 30

PostPosted: Fri Jul 27, 2018 1:48 pm    Post subject: Multiple stacked plots Reply with quote

Hello David,

I wonder if you've given "stacked plots", i.e. multiple plots that are plotted together in an additive fashion, such that of for time series A~C, B is actually plotted as A+B and C is plotted as A+B+C, usually drawn as filled graphs. I've seen a few examples of requests like this, for example here:

https://www.visualdatatools.com/phpBB2/viewtopic.php?t=1181&highlight=stacked+plot

I was just thinking that your (relatively new?) "Plots" command could be a fantastic interface for stacking graphs in this manner in an intuitive way, compared to the multiple function columns and plot commands required to do this. I would be very excited by the possibility of being able to drag items on the Plots list to change the order of the stacking, something that would be really tedious to do in the conventional way...

Thanks,

Jooil
Back to top
View user's profile Send private message
Pamela



Joined: 25 Feb 2017
Posts: 44

PostPosted: Wed Aug 22, 2018 7:18 pm    Post subject: Reply with quote

Hi Jooil,

Pamela here...

Thanks for revisiting this question. A command that I don't think we had when this was initially asked is the Pivot command. The Pivot can create stacked graphs and do all sorts of data processing (e.g., sums, means, and counts). In that regard, it is much more powerful than the Plots command, which is only for displaying values already in the data table.

The Pivot command can also order the data in the plot based on the magnitude.

For example, here is an area graph made with the Pivot. This is summing energy consumption for each year from monthly data from the EIA. https://www.eia.gov/totalenergy/data/monthly/
Notice how the category with the greatest magnitude is on the bottom and they generally increase as you move up.

To do this, you set up a Pivot and change the drop-down menu to the right of Map Columns from "Automatic" to "Decreasing".

If this was set to automatic you would get alphabetical...bottom to top


There are ways to set the order exactly how you want it too, but for larger data sets, the ordering based on magnitude can be much faster.

For you to use the Pivot command, your data must be what we call "Flattened", into no more than three columns. We have an automated way to Flatten data that is demonstrated in this video on our youtube channel.
https://youtu.be/zLNi-_WyfM8?t=5m11s

We are considering adding the area option to the Plots command, but I wanted to make sure you are aware of how the Pivot can be used for this, as it is gives you many options for displaying and processing data all in one step.

Here is a link to the file used to generate this graph...
https://www.visualdatatools.com/phpFiles/20180822--Pivot/Pivot--StepbyStep.dgraph.zip

I also put together a step-by-step guide to show I created this graph that is also in the DataGraph file.
https://www.visualdatatools.com/phpFiles/20180822--Pivot/Step-by-Step.pdf

Is this example, similar to what you were hoping to do?

Pamela
Back to top
View user's profile Send private message
kji2080



Joined: 04 May 2009
Posts: 30

PostPosted: Thu Aug 23, 2018 9:21 pm    Post subject: Reply with quote

Hello Pamela,

First off, thank you for the detailed answer, and the link to the video you've made. I must say, there were a lot of things I didn't know DG could do!

Regarding the use of Pivot to do stacked plots, this is something I didn't realize was possible. It seems to me that I need to do some work to format my data to make this possible. For example, my "time" variable (x-axis) is not just a handful of years but about a year worth of time in 1-hour increments, so I had a separate "time" column with the timestamps rather than having each time stamp be a separate column. So, it might look a little messy, but I think it could work.

I continue to think the Plots command would be ideal for stacked plots, and for now I've resorted to doing some coding outside of DG and plotting individual Plot commands for each "stack", but will look forward to whether you guys can come up with a cleaver solution here.

Thanks,

Joseph
Back to top
View user's profile Send private message
Pamela



Joined: 25 Feb 2017
Posts: 44

PostPosted: Fri Aug 24, 2018 1:22 pm    Post subject: Reply with quote

Having the area option in the Plots command is a good idea and I am hoping we can do that early this fall.

FYI - DataGraph handles dates and times very well. I am not sure I exactly understand your format but having your data in one-hour increments should not be an issue. When you get a chance I would recommend trying that column in a the Pivot -- without any pre-processing of the data. As long as the column is understood in a "Date" column (it can also contain just time data), it should work.

As shown in the screenshot, the time increment that is displayed can be varied without any processing of the data. This includes years, months, weeks, etc. The plots posted here were created from a monthly time series, without any pre-processing to years - that grouping done was done automatically by the Pivot command, because Map rows was set to "Years".

You're also welcome to email an example of your time-stamps (help@visualdatatools.com).

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Feature Request All times are GMT - 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group