From the course: Rust for Data Engineering

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Simple charting of data structures in Rust

Simple charting of data structures in Rust - Rust Tutorial

From the course: Rust for Data Engineering

Simple charting of data structures in Rust

- [Instructor] Okay, in today's coding session, I'm going to demonstrate how to visualize data using this rasciigraph library in Rust. You can see here from the official documentation, pretty straightforward, you put in a vector, and it's able to with a few configuration options, print out a nice little ASCII graph here. So if I go over to my code here and we look at this main here, I again go to the dependencies and add this. Next up, what I do is I configure a plot and a Config. What I'm going to do in this particular example is look at several cities. So Lisbon, Madrid, Paris, Berlin, Copenhagen, Stockholm, and Moscow. And I create a vector that shows the distance from each of those cities. So Lisbon to Lisbon is zero Lisbon to Madrid is 502 kilometers. Lisbon to Paris is 1,053 kilometers, and so on, and so on. Now what I do is I print this all out using this library and it's pretty straightforward to have it work.…

Contents