Skip to content

Fuad-HH/plotXRDwith-ggplot2

Repository files navigation

Plot RIGAKU Smartlab Xray Diffractometer Spectrum with ggplot2 (an R package) Directly Using the csv Files.


Though this machine can automatically analyze data and produce great plots, sometimes it is needed to do it on your own to get full freedom.
These R scrips are intended to plot the XRD data from csv files produced by the RIGAKU Smartlab Xray Diffractometer analyzer.

Required Files

Two files named *data.csv and *peaks.csv are produced for each sample.
* -> Sample Name

The *data.csv file can be produced in two formats.

  1. One with only the Sampled Intensity and Background Intensity
  2. And the other with several Individual Peak columns.

Description of Scripts

There are two scripts:

  1. The plotOnlyCount.R is a very simple code to just read the *data.csv file to plot only the Intensity vs Angle plot. Please make sure that you have the first kind of *data.csv file. If you have the second format, change the column numbers in the script accordingly to choose the appropriate columns.
  2. The xrdPlots.R is also a simple script to plot Intensity of Sample, Background Intensity, and Calculated Intensity along with the Peak Locations from the *data.csv and *peaks.csv files. Please make sure that you have the second type of *data.csv file.

Important Notes:

  1. You have to download or copy the scrips in RStudio to run,
  2. Make sure you have tidyverse package installed, and
  3. An alternative way is to use RStudio Cloud to avoid installing it on the local machine.

Sample Plots

1. Using plotOnlyCounts.R:

Sample Plot for Script 1

2. Using xrdPlots.R:

Sample Plot for Script 2

About

These R scrips are intended to plot and XRD data from the csv files produced by the RIGAKU Smartlab Xray Diffractometer Analyzer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages