TransWikia.com

Tools for nutritional value tracking and visualization

Data Science Asked by nyoung4 on October 3, 2021

I want to track the nutritional value of different flours over time. What I got so far is a
data table like this:

|------------|------------|------------|------------|
|   Flour    |   Date     |   Energy   |   Sugar    |
|------------|------------|------------|------------|
|   type 1   |   03/20    |   310      |   2        |
|   type 2   |   03/20    |   290      |   1.8      |
|   type 1   |   04/20    |   310      |   2.1      |
|   type 2   |   04/20    |   287      |   1.7      |

Over time, I will add more nutritional values for the flours already in the table and
might add more types of flour. I might also want to add additional columns e.g. for protein.
The nutritional values of the different flour types should then be plotted over time
like this:

Energy
|
|     *         *             * type 1
|     #                       # type 2
|               #
|
|-----------------------Date
    03/20     04/20

What are the best tools to implement such a project?
My constraints are that I only want to use free and open-source software which runs under Arch Linux and that that i can export the plots

2 Answers

I would recommend the Python libraries: matplotlib and seaborn for generating and exporting static plots, or Plotly for interactive plots with hover features that you can export to a web browser.

Answered by Derek O on October 3, 2021

I suggest R. It allows for easy data handling including a good GUI (RStudio) and high-quality plotting tools (e.g. ggplot2).

df = data.frame(c(1,2,3,4,3,4,8,6,2,3),c(5,4,3,6,5,4,2,6,7,8),c(1,2,3,4,5,6,7,8,9,10))
colnames(df)<-c("a","b","c")
df

library(reshape)
df2 = melt(data = df, measure.vars = c("a", "b"))

library(ggplot2)
ggplot(df2, aes(x = c, y = value, colour = variable)) + 
  geom_smooth() + geom_point() +
  xlab("My x") + ylab("My y") +
  ggtitle("My ggplot") +
  labs(color='Type') 

enter image description here

Answered by Peter on October 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP