
Brett Champion walks through Wolfram Language's latest visualization tools: plot highlighting for interactive exploration, high-dimensional pairwise plots, ternary diagrams, new scaling functions covering 70% of plotting, and shader effects like blur and drop shadow.
Chapters
Hello, welcome. My name is Brett Champion and I'm the visualization manager here at Wolfram Research. And today we're going to be looking at an overview of new features in the Wolfram language for the past few versions with regard to visualization and graphics. So the rough overview of topics which we'll be going through in not too much detail and hopefully quickly enough to still allow some time for questions are highlighting of visualization functions, high dimensional visualization, ternary plots, recent expansions and scaling functions, and scales, and some additional features available for plot styling. Before we dive into that, I want to take a moment to plug some additional resources that people might find useful. So this is the first talk in a whole string of them this afternoon about graphics and visualization. So besides my talk right after this one, Minquan Peng is talking about interactive highlighting. Following that at 01:30 Nirmal Malapaka will be talking about tabular data visualization. And then Alex Shtelbauer will be talking about advanced graphics with shader graphs. Yutzulu will talk about more shader related technology. And finally ending up the graphics and visualization sequence for today will be James Lane talking about other additional new features in graphics. Then Tomorrow morning at 9:30 Central Time, the team will be available to answer questions generally during office hours about visualization and graphics. And so I hope people are able to visit that. And if there are questions I don't get to today, please try to show up tomorrow and bring them with you there. I really enjoy having the office hours. I think that's always a highlight for me of the conference. Additionally, I want to mention that the algorithms team here at Wolfram has a YouTube channel where we post videos roughly about once a week. And so if you've followed those, some of this material that I'm going to present might be familiar already, some of it may not. But that is sort of an opportunity to have a tech conference like experience spread over the entire year. So that's an additional resource. And the talk notebook is available in handouts and if you have questions, put them in the Q and A section and I'll mostly try to answer them at the end, but I may do some things during the talk as it comes up. So diving in. So starting off with highlighting. This is a new feature as of version 13.3. And so this is a stacked list plot. It has three curves with some filling. And what will happen is, and this is turned on by default when I mouse over the plot, the point that I'm closest to or once I'm Close to a point, I should say I'm going to get a little dot indicating where what point I'm looking at and what the coordinates of that position are. So in this view it may be a little bit small, but I can see that this point on the yellow curve is 8.45 in the x direction and 17.45 in the y direction. And. And if I move to a different curve then I get a point there and the styling for the point and the tooltip are matching the curve and down on blue still the same. And you can change and customize what the appearance of the highlighting is. So we have one that I like which is called X slice. And rather than look at one curve at a time, it's going to look at all of them. And so when I move over, I now get a vertical line going through all the plots with a point for each plot and a label for each plot. And in this case it's just showing the Y values for the labels so that the X value doesn't get repeated for every curve and become noisy and take up more space. And as I was saying, this is on by default there's and it applies to most of the plot functions that generate curves or points. There are limits. So with the default setting, with automatic setting, if your plot has more than 10,000 points in total, it will turn off for performance reasons. You can still use plot highlighting goes to all to turn it back on if you really do want highlighting and you have lots and lots of points or you have lots of curves with not so many points. Additionally, we have the ability to do static highlighting. And so in this case we're using our same X slice highlighting effect, but we're saying that we want this to happen at x equals 7. And so then in that case we get what we would have seen if we moved over here to x equals 7. Except the data set is different in this case, but you get that effect as a permanent thing. And so that's useful if you need to take a screenshot of it or you want to export it to a file or include it in a paper that you're publishing or otherwise share it with somebody or keep it for posterity. So you can use place to have static highlighting. And this is the quick overview of this. Min is going to go into this in more detail in his talk following this one. Next up we are going to look at some things in high dimensional visualization. And so this is a V14 feature that is coming soon. And so this is introducing new family of Pairwise visualization plots for dealing with data that has lots of dimensions. And by lots of dimensions, I mean, you know, if you count XY as two dimensions, XYZ is three dimensions. This is A, B, C, D, E, F, G, H, I, J, you know, type data. So here we have a small data set. So we have Fisher's iris data. We have four of the columns here included. So sepal width and sepal length and petal length and petal width in some order. And I'm showing a subset of the table here. And so every row is one iris, and every column is one measurement. So I believe this is sepal length, and this is sepal width and petal length and petal width. And so the pairwise plots, I mean, in general, this visualization type has been around for a long time. And so if I can get this. So each of these plots is one column against another column. So the diagonals are kind of boring because it's column one against column one. And so every point is of the form 5.1, 5.1, or 4.6, comma, 4.6. But then if we move over to, like this position, actually, let's go over to this position. So here on the X axis of this plot, we have petal length, which is this green column. And on the Y axis we have the sepal length, which is the orange. And so every point here is of the form 1.4 5.1, or 1.7, 5.4. And so you do that for every combination. And of course, you know, if this is one row and column, then if this is what we say, sepal length versus petal length, then its mirror image is the other way around. So it's petal length versus sepal length instead. And so you can sort of see that there is sort of a reflection between these two because we've effectively just swapped the X and Y coordinates. And so this is, as I said, a new feature in version 14. It's experimental, partially because there's a lot of things that we want to do with it that we just haven't been able to do yet. And so what's there now is the starting point, and we have bigger plans for it. Similarly, we have some other functions that are this behave similarly. So we have pairwise density histogram and pairwise smooth density histogram, which take the same, you know, which basically take these points and feed them into density histogram and smooth density histogram. And so then we get things that look the same, I mean, that are the Same structure, but have a different visual feel. So you can see where the densities are and that sort of thing. We also have pairwise quantile plot and pairwise probability plot. The general concept is the same. The difference is that because of the nature of how quantile plot and probability plot work, each of these points no longer represents a single row. So it could be that for a given point that the X value is coming from one row and the Y value is coming from another row. You know, if you were to independently sort the columns in the data set, then it would match up, you know, row, row, row, row. But in general, that's not what's being done. So that's not exactly how to interpret it. Although, I mean, it's still the case that. So whatever point is above 3 in the x direction here, that is the same in every one of these panels. And likewise the Y direction is constant going across the panels. So now we'll look at ternary plots. These were introduced, I believe, in 13.1. And so these are a way of visualizing data that makes up a whole. So if you have three components that are mixed together in some proportion, then we can use the fact that everything is adding up to a whole, adding up to some constant, to go from three dimensions down to two dimensions by effectively solving, using this equation, you know, using X plus Y, X plus V plus W equals 1 to eliminate 1 of these variables. And so this then becomes a little bit trickier to interpret sometimes because you have three axes and you have a point that corresponds to the values on those three axes. And importantly, when you're going from the point down to the axis, you aren't going to and sort of to a perpendicular, you're going in a direction that is parallel to this other axis. And so these dotted lines are where the coordinates are read off. And so this point that's in the middle is basically about 1/3 on each of these axes. And so we have 0 for this blue axis goes to 1, and we trace this back to 1/3 here for that. And if you turn on the grid lines which are on in this plot, but it's very faint, then the grid lines are also forming triangles. The tick marks are rotated to help you identify which direction to go. See. So I'll take a moment real quick to answer some questions. Will there be a plot highlighting equivalent for 3D plots? Hopefully, eventually, yes. That isn't fully prototyped yet. And I think there's some additional functionality we'll need to be able to figure out sort of what you're pointing at that becomes quite a bit trickier. Does Wolfram language have the ability to produce stereo 3D plots? I don't think there's anything natively built in, but people have certainly done it over the years by say, creating two copies of the image with different view angles and viewpoints and that sort of thing. Can you change the font size of the points and labels being used for plot highlighting? And yes, some of it is documented, some of it isn't. The font size for the most part should happen automatically. The presentation notebooks that we use for talks are very special and do some interesting things with graphics and so it doesn't happen. It didn't happen automatically in this notebook, but in general in a regular notebook it should that if you set label style on the graphic it should reflect that. So coming back to. And then we'll answer Seth's question real quick. For pairwise list plot, can you group the data so that you get multiple data sets? Yes, and I'll let Nirmal show that in his talk. So coming back to ternary plots, sort of the oldest ternary plots I know of were done with regard to color. And so the three components were rgb. But there's other applications. Another application where it's been used a lot is in geology. And so you look at soil composition and how much of it is clay, how much of it is sand, how much of it is silt. And this is important for if you're building a building, especially if it's not just a one story house that you want to know what sorts of supports you need to build it safely for its occupants. So we'll get into scaling expansions now. So over the past few versions there's been a big push to enable scaling functions everywhere almost that we possibly can. There's a few that we can and haven't yet. But for the most part we're at about 70% of the visualization functions support scaling functions. And a lot of the ones that don't are things where it really doesn't make sense or at least I don't see a use for it yet. So things like GEO list plot or anatomy plot, 3D or molecule plots, a lot of physical things where the scaling isn't clear what it would do. So here we have a regular stream plot and if you want to or have an application where you need a log scaled x axis and a reversed Y axis, put that in and out it comes. So we've also extended what types of scales you can have for scaling functions and so we always had sort of log and reverse and reciprocal. And now we also have datescale as an object, not date object, datescale as an object. That allows you to say, I want to use a date scale. And additionally it has the ability to allow you to specify or control how your data gets interpreted. So here we have. Our X coordinates are strings and it's a pair of numbers separated by a hyphen. And this is sort of constructed to be ambiguous. Is this the first of every month? Is this January 1st, January 2nd, et cetera. So I can say I want to interpret it as month, day, and then I get the January's along the x axis. Or I can say that I want it to be month, I can be. Want it to be day, hyphen, month. And then I get, you know, sort of the same curve, but now my axis is different. And then we also introduced nominal scale and ordinal scale for dealing with categorical scales. And so nominal scale is things where it's just a collection of objects. So here we have, you know, I've flipped a coin a hundred times. It was a virtual coin, it was nearly instantaneous. And stuff came up heads and stuff came up tails. And I can sort of look at what the sequence was of. Where did I get runs of heads? Where did I get runs of tails? Interestingly, that isn't getting picked up in the tooltip for plot highlighting. So that's a thing to look into. I can say that I want the same thing, but I want, you know, besides my category, whatever my categories were coming in, this is how I want them to be labeled. And so that can be useful Sometimes this is a programmatic thing and you want something that's more readable, or you want something that's smaller so it fits better on the axes, or for whatever reason, you have the ability to control what the labeling of your categories is. Ordinal scales are similar to the nominal scales, but there's an order to them. So there is a least element, there is a most element. And for any two elements, A and B, you can determine that A is less than B or B is less than A. And so, you know, so one consequence of that is, I think if I were to evaluate this multiple times, maybe it looks like it's always coming up in the same order, but it's probably more implementation detail than anything intrinsic that tails is less than heads or something. In this case, it very much is the case that we're specifying a list in terms of what the order is. So Totally dissatisfied is worse than dissatisfied, which is worse than neutral, satisfied and totally satisfied. And additionally, because, you know, I mean, it could be that there's just an ordering, this is less than that, and, you know, less than the other thing. But it could also be that you want to additionally say that there's a weight associated with this or some measure of distance. So for, you know, maybe I have a bunch of, you know, out of these values, I want to say that totally satisfied is way, way better. It's a bigger step above satisfied than satisfied is above neutral. And so then I can provide, you know, what values I want to give these things, and it will space them accordingly on the axis. So that's ordinal scales and nominal scales, sort of a newer thing. I don't think a lot of people have really gotten into them yet. I think there's some projects coming up that hopefully will make them even more useful and important. But I want to finish up my talk, or at least the presentation part of the talk, talking about some styling changes and additions. So we've updated the default gradient for density, plot, contour plot, a bunch of related functions. And so these are, you know, they previously were sort of a dusty blue to a tannish. And we've gone to something that has a darker dark and a brighter light and is generally, generally just, you know, sort of a brighter, more poppy color scheme. And so you have a wider range of dark delights. You have more chance for detecting features in the middle there. And this is also closer to what we are using for the vector visualization functions, starting, I think in about version 12.1 or thereabouts, where it's a sort of bluish purple to orangey yellow color. For the vector plots, it doesn't go quite as extreme, especially not into the pale yellow, because those vectors as lower dimensional objects wouldn't show up. But it's in the same family now of gradients that are being used for that. We also have various shader effects that can be used as directives and graphics. And so we have blurring, which takes your content, which in this case is the text Wolfram and a thick circle and just draws it in a blurred way with a given blurring radius. We have drop shadowing, which basically takes that blurring and uses it as an offset backdrop behind the object. And so this gives you sort of a sort of a 3D light 3D effect. And it helps to emphasize sometimes what this Wolfram is. I mean, what this front content is, because that 3D effect brings it to the front and helps it stand out a bit. Interestingly, drop shadowing came before blurring. We implemented this and like, oh, we could just do the blur thing on its own. And so we did. And then finally we have haloing, which is new in 13.3. And this, in its simplest form, is putting a border around the outside of things. And there's a lot of flexibility here. You can have the border on the outside, you can have the border on the inside. Putting the border on the inside can be a cool effect sometimes. And you have a. You can have a sharp border and then a fading border that blurs out. And the. Typical case for this I seem to not have in this notebook. So I will try to recreate it in 30 seconds or less. So let's do. Pattern filling of checkerboard. And I want that to be scoped, That text at 0.0.5, Copy of this. Never type haloing. I always want to put a W in it. Nice big halo around it. Close off that. And we want this to go from minus 1, minus 1 to 1, 1. And I want that one down below. The intended application where we really wanted haloing was to be able to make text visible across complicated backgrounds. Here we have a checkerboard. We have text in front of it, and the text just gets completely lost on the top here. Whereas if we put the halo around it, then because we are using contrasting colors for the halo and the text, then it's sort of guaranteed to show up against anything. So. And these can be used as part of a plot style. So this is a plot with haloing being applied to one of the curves to draw even more attention to it. It can be used in chart style. So here's a drop shadow being used on the bars or as part of the bar specification. So that concludes everything I wanted to talk about. And I'll spend about a minute and a half, two minutes answering questions as best I can. If I don't get to it. Like I said, bring it to office hours tomorrow and hopefully everybody's able to move over to men's talk and find out more about plot highlighting and everybody else's talks after that. Do drop shadowing and haloing work in the cloud? They should work in the cloud. It probably just gets rasterized. I'm pretty sure they do. They. They should work. I don't know what the performance is. Let's see. Can plot highlighting be turned off by default in a notebook? There isn't a documented way to turn off plot highlighting globally for everything and within a thing. You can set, you know, plot highlighting goes to none, and that would turn it off, but it's not currently controlled by any sort of global setting. I think that's about all I have time for to answer right now. Thank you all for coming. Enjoy the rest of the conference and the rest of the talks, and hope to see you in the office hours and other talks later on. So thank you.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






