Live data from Hacker News

Using Altair for most of my visualization in Python

fernandoi.cl

61–70 of 75 posts

Re: Using Altair for most of my visualization in Python

#61
In the grand scheme of things it's a minor gripe, but I really dislike APIs that encourage chaining of calls like `alt.Chart(data).mark_circle(size=200).encode(...)` from the article. This is found in many other libraries, especially JavaScript ones like e.g. jQuery. I know it's compact, but it makes it harder to see what's going on and hides the fact that all of the operations are actually being applied to the leftmost object.

Re: Using Altair for most of my visualization in Python

#62
post #61

In the grand scheme of things it's a minor gripe, but I really dislike APIs that encourage chaining of calls like `alt.Chart(data).mark_circle(size=200).encode(...)` from the article. This is found in many other libraries, especially JavaScript ones like e.g. jQuery. I know it's compact, but it makes it harder to see what's going on and hides the fact that all of the operations are actually being applied to the leftm…

SmallTalk has the correct answer here, with its method chaining operator `;`, I feel. For cases like this where you build complex state on an object via method calls, it gives some pretty nice code. And since it's a separate construct, the individual method calls can have return values that make sense too, as opposed to this style of interface where the methods all have to return the object again for chaining.

Re: Using Altair for most of my visualization in Python

#63
post #31

The problem with all these nice new visualization libraries for Python, is that they all (at least the shinny nice ones) fail totally short when it comes to do B&W graphics for journal publications. Things like filling patterns, line patterns etc, are mostly missing. I still use Matplotlib and I can make it look beautiful and exactly how I want... it's just a lot more work to get the shinny bits.

For my thesis, I tried a couple of different options, but in the end the only one that really made publication-grade output was gnuplot with the epslatex terminal. It's a bit fiddly to get it up and running, but hands down the best result I think.

EDIT: Spelling.

Re: Using Altair for most of my visualization in Python

#66

As part of our work, we create data dashboards. We use NumPy and Pandas to analyze data, either Flask or Django as a framework, and HighCharts for interactive charts. The JS charting library has a variety of charts to meet our needs. Our input stored either as SQL or CSV is dynamic data. I am beginning to wonder if HighCharts is replaceable with a fully open-source charting library.

I should be pretty easy to set this up with Dash by plotly, and you can host in various places.

Here a guide we've written for an app where you can drag and drop a file and get a chart from it.

https://kyso.io/KyleOS/creating-an-interactive-application-u...

But you can extend to take an SQL query or maybe to set up an external api call.

Re: Using Altair for most of my visualization in Python

#68
post #14

I'm looking for an interactive visualization tool that I could have site visitors access via a github blog page. Does Altair manage client-side processing? I'm still pretty new in the search but like Altair's adoption of Vega-lite.

Here's a guide to using Github+Kyso [1] to publish your type of article to the web, it should be a very similar workflow to github pages, and you can use any of the popular python visualization libraries - we support plotly, bokeh, vega, altair, matplotlib etc.

https://towardsdatascience.com/publish-data-science-articles...

[1] Disclaimer: I'm the CEO of Kyso

Re: Using Altair for most of my visualization in Python

#70
post #17

How is Altair on 3D data? I see no examples of this. Matplotlib is decent here (apart from all the same disadvantages the author lays out), but the default options look kinda fugly.

Plotly supports interactive 3d scatters, lines, surfaces, cones, streamtubes, volumes and isosuraces :)

https://plot.ly/python/3d-charts/

Post reply on HN