![]() I am sure people will have lots of questions and comments on this topic. Feel free to provide feedback in the comments. You can save them offline and create very rich web-based visualizations.Īs it stands now, I’ll continue to watch progress on the ggplot landscape and use pygal and plotly where interactivity is needed. Plotly generates the most interactive graphs.It is not as flexible as the matplotlib based solutions. pygal stands alone by being able to generate interactive svg graphs and png files.bokeh is a robust tool if you want to set up your own visualization server but may be overkill for the simple scenarios.ggplot has a lot of promise but is still going through growing pains.Seaborn can support some more complex visualization approaches but still requires matplotlib knowledge to tweak.Pandas is handy for simple plots but you need to be willing to learn matplotlib to customize.I don’t see one clear winner or clear loser. To some degree, you need to play with the tools to figure out if they will work for you. Trying to figure out which ones works for you will depend on what you’re trying to accomplish. The bad news is that there are a lot of options. The good news is that there are a lot of options. Plotting data in the python ecosystem is a good news/bad news story. Because of the docs and the python api, getting up and running was pretty easy and I liked the final product. The out of the box plot is very appealing and highly interactive. You can see a lot more robust examples on their site. Py.image.save_as(fig, 'mn-14-budget.png')Ĭheck out the full-interactive version too. Plot_url = py.plot(data,filename='MN Capital Budget - 2014') You get the interactivity of a rich web-based report as well as the ability to save a local copy to for embedding in your documents. I originally didn’t see this but you can save a local copy as well, using py.image.save_as. ![]() This will open up a browser and take you to your finished plot. I also decided to add some additional layout information. Setup the data and chart type for plotly. Setup my imports and read in the data import otly as pyīudget=pd.read_csv(“mn-budget-detail-2014.csv”)īudget.sort(‘amount’,ascending=False,inplace=True) I also will give a shout out to them for being very responsive to an email question I had. Plotly integrates pretty seamlessly with pandas. There is an option to keep plots private so you do have control over that aspect. The one caveat is that everything you are doing is posted on the web so make sure you are ok with it. Once you do, it seems to all work pretty seamlessly. You’ll need to follow the docs to get your API key set up. Thanks to the excellent documentation, creating the bar chart was relatively simple. Browsing the website, you’ll see that there are lots of very rich, interactive graphs. It has robust API’s and includes one for python. Plot.ly is differentiated by being an online tool for doing analytics and visualization. I encourage you to download the svg file and look at it in your browser to see the interactive nature of the graph. I also found it relatively easy to figure out what I could and could not do with the tool. I think the svg presentation is really nice and I like how the resulting graph has a unique, visually pleasing style. Now render the file as an svg and png file: bar_chart.render_to_file('budget.svg') for index, row >in errows():īar_chart.add(row, row) Performance might be an issue when there are lots of rows. This is where the integration with pandas is not very tight but I found it straightforward to do for this small data set. One interesting note is human_readable which does a nice job of formatting the data so that it mostly “just works.” Now we need to add the data to our chart. Legend_at_bottom=True, human_readable=True, We need to create the type of chart and set some basic settings: bar_chart = pygal.Bar(style=LightStyle, width=>800, height=>600, Do our imports and read in the data: import pandas as pdīudget = pd.read_csv("mn-budget-detail-2014.csv")īudget = budget.sort('amount',ascending=False) I also found that it was pretty easy to create unique looking and visually appealing charts with this tool. The svg files are pretty useful for easily making interactive charts. If the proper dependencies are installed, you can also save a file as a png. ![]() Bokeh has a lot more functionality but I did not dive into in this example. ![]() I did not find a simple way to more easily format the y-axis. bar = Bar(amount, details, filename="bar.html")īar.title("MN Capital Budget - 2014").xlabel("Detail").ylabel("Amount")Īs you can see the graph is nice and clean. I was able to save a png copy in case I wanted to use it for other display purposes. This code causes the browser to display the HTML page containing the graph.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |