# Help Making Figures/Scatterplot?

**URL:** <https://community.mrtrix.org/t/help-making-figures-scatterplot/7877>\
**Category:** Uncategorized\
**Created:** [August 21, 2024, 3:34pm UTC](https://community.mrtrix.org/t/help-making-figures-scatterplot/7877 "2024-08-21T15:34:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Campbell](https://community.mrtrix.org/user_avatar/community.mrtrix.org/ivan_campbell/32/4449_2.png) [@Ivan\_Campbell](https://community.mrtrix.org/u/Ivan_Campbell)\
**Post date:** [August 21, 2024, 3:34pm UTC](https://community.mrtrix.org/t/help-making-figures-scatterplot/7877/1 "2024-08-21T15:34:03Z")

</div>

Hi all, I’m a grad student new to imaging visualization and I need some help. I’ve followed [this guide](https://mrtrix.readthedocs.io/en/0.3.16/workflows/fixel_based_analysis.html) to fixel based analysis and got some great results! However, I need some assistance in figuring out how to translate what I’m seeing in Mrview to a 2D figure for publication. Specifically, I had 2 main points I wanted to ask about in order to make figures similar to figures 2 and 3 in [this article.](https://link.springer.com/article/10.1007/s00406-023-01598-7) Firstly, how do I actually get a scatter plot of correlations between FDC and my variable of interest from mrtrix? Or at least the data from the fixels to make those scatterplots? Secondly, how can I turn these significant fixels into ~aesthetically pleasing~ figures that might make some more sense? I’ll upload an example of where I’m at right now as well as the figures I’m more or less trying to replicate. Thank you all so very much for any help you can give!

 ![Screenshot 2024-08-21 102804](https://community.mrtrix.org/uploads/default/original/2X/9/9fa45ed49a0ed66d063e400b286ed21d1f998814.png)  
 ![Screenshot 2024-08-21 103245](https://community.mrtrix.org/uploads/default/original/2X/e/ea10ef12619e2700f9c5fe65d7825902fd55b528.png)  
 ![Screenshot 2024-08-21 103254](https://community.mrtrix.org/uploads/default/original/2X/d/d5a1d9044870fc972c14c8259985539c7715fdae.png)

---

<div class="post-metadata">

**Author:** ![adsouza](https://community.mrtrix.org/user_avatar/community.mrtrix.org/adsouza/32/4571_2.png) [@adsouza](https://community.mrtrix.org/u/adsouza)\
**Post date:** [August 22, 2024, 12:43am UTC](https://community.mrtrix.org/t/help-making-figures-scatterplot/7877/2 "2024-08-22T00:43:05Z")

</div>

Hi Ivan,

> [@Ivan\_Campbell](#):
>
> Firstly, how do I actually get a scatter plot of correlations between FDC and my variable of interest from mrtrix?

Here is a potential plan of attack

1. get a fixel mask of the region (for example, CST). This can be computed using `tck2fixel $TractSeg_region_tck $fixel_directory_in $fixel_masks_dir $Region_fixel_mask` (assuming that TractSeg was used to generate the CST bundle).
2. compute the average FDC metric for each subject in the region. This can be done using `mrstats <FDC_subject#.mif> -mask $Region_fixel_mask`. To print out only the mean, consider adding in the option `-output mean`. Loop through the subject list and print (and append) the output to a text file (along with the subject label).

See [here](https://community.mrtrix.org/t/extracting-fd-fc-and-fdc-using-tractseg/7790/2) and [here](https://community.mrtrix.org/t/calculating-average-fba-metrics-of-specific-tracts/1805/2) for more information on this topic 😃

Cheers,  
Arkiev
