Chantz Posted September 20 Share Posted September 20 I'm new to Spotfire, just trying it out - and working to re-create some visualizations that I currently make using Python. Is there any way to make a scatter plot, and then overlay a calculated trend on it? Something that looks like this. This example shows two sets of data, but then overlaid on each dataset I have a line that is the average of the X values, binned in increments of 200 on the X values. I've been messing with it for a while, and through the Lines and Curves interface I can easily make horizontal lines or vertical lines - but there isn't a simple y(x) function that recreates the average trend lines. Link to comment Share on other sites More sharing options...
Olivier Keugue Tadaa Posted September 20 Share Posted September 20 Hi Chantz, that should be possible. Is there any chance you could send us a sample dataset? That would be easier to help you with. Link to comment Share on other sites More sharing options...
Chantz Posted September 20 Author Share Posted September 20 Sure, here's an example dxp. I assume this is the correct way to share a sample? Shared_File.dxp Link to comment Share on other sites More sharing options...
Olivier Keugue Tadaa Posted September 20 Share Posted September 20 (edited) Thanks for the example. hoping to have understood the need, I created a basic line from a curve Draw with the below formula : Add any formula y(x) = a*x+b (where a and b are any numerical values), that will draw your line if you have the equation. You also have some advanced functions you can apply to x Here is a sample output... Edited September 20 by Olivier Keugue Tadaa Link to comment Share on other sites More sharing options...
Chantz Posted September 20 Author Share Posted September 20 Yes, what you've got there is about what I was able to accomplish (minus the two colors). I figured out how to make a function to output a value of y for every x, unfortunately I'm not trying to show the general trend of the data like with linear regression or something to find a line that best fits the point cloud. I'm trying to show the actual average weight trend, so the plotted line would basically follow the center of the point cloud from 0 to 20000 ft. It's a vague fit, but is doesn't track the center of the trend. The data doesn't follow a simple formula, so what I am doing in my Python example is binning the data into 200 ft bins, and averaging the weight for each of those bins and plotting the value at the center of the bin. I can generate the plot I want, sort of, in two separate scatter plots. In the screen shot I've done it two different ways, one using binning in the plot itself to make the trend I want (left) one using python to create a table that has the exact points I want (middle) and then the actual scatter plot of the data over on the right side. (This data is only looking at the orange highlighted group) What I would like to be able to do is overlay one of the binned plots (left or middle) on the scatter plot, but have the points connected by a line - not plotted as scatter points - similar to the plot I showed in my first post. I've poked around everywhere, and am inclined to believe it's just not natively supported in the spotfire scatter visualization... but I'd love to be shown otherwise. =) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now