Generating graphs using plot.ly
Sometimes it’s really nice to have a visual representation of your data. In this recipe, we are going to look at using the plot.ly
python API to generate a nice graph.
Getting ready
In this recipe, we will be using the plot.ly
API to generate our graph. If you don’t already have one, you’ll need to sign up for an account at https://plot.ly.
Once you have an account, you will need to prepare your environment for using plot.ly
.
The easiest way is to use pip
to install it, so simply run the command:
$ pip install plotly
Then, you will need to run the following command (substituting the {username}
, {apikey}
, and {streamids}
with your own, which are viewable under your account subscriptions on the plot.ly
site):
python -c “import plotly; plotly.tools.set_credentials_file(username=’{username}’, api_key=’{apikey}’, stream_ids=[{streamids}])”
If you are following along with this example, I used the pcap
file that is available online here for testing: http://www.snaketrap...