Skip to content

daipom/graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graph

This is a Python script to easily create a scatter graph using plotly.

plotly is a very useful library to create a graph as a standalone HTML file. However, it is difficult for me to remember the many options of plotly.

I have made it easy to create graphs for very common cases. You can use this script to create a common scatter plot quickly and easily.

  • Read one or multiple CSV file(s).
    • When plotting multiple files, the first column needs to be the same kind, such as datetime.
  • Use the first column as X-values.
  • Use the other columns as Y-values.
  • (Option) Change the type of X: time series (datetime or elapsed seconds) or simple scatter.
  • (Option) Use 2 Y-axis to plot data in different units and scales simultaneously.

How to use

Prepare

Need pandas and plotly.

$ python3 -m pip install pandas
$ python3 -m pip install plotly

Help

$ ./graph.py -h

Examples

Simple time-series graph

$ ./graph.py sample/simple.csv --yaxis-title Value

Use 2 Y-axis

$ ./graph.py sample/resource.csv --yaxis-columns Memory --yaxis2-title "ProcessorTime(%)" --yaxis2-columns ProcessorTime

Use multiple files

$ ./graph.py sample/simple.csv sample/resource.csv --graph-title "Plot multiple files" --yaxis-columns Memory --yaxis2-title "Other values" --yaxis2-columns ProcessorTime Value1 Value2 Value3

Simple non-time-series scatter graph

$ ./graph.py sample/not-timeseries.csv --not-timeseries --yaxis-title Value --with-markers

About

No description, website, or topics provided.

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages