Introduction
This application is developed with pre-university physics students in mind. It provides a simple tool for plotting
graphs with error bars and determining the best fit line for their data. It is particularly designed for students
with minimal experience using spreadsheet software such as Microsoft Excel or Google Sheets.
While this app serves as a helpful introduction, it is neither a substitute for sophisticated spreadsheet software
nor a replacement for professional data analysis tools. Students are strongly encouraged to learn and master basic
spreadsheet skills. Additionally, they are invited to explore advanced software, such as OriginPro for professional
use or free alternatives like SciDAVis and LabPlot, to further
enhance their data analysis capabilities.
Features
This app allows you to input data, visualize it through interactive graphs, and perform various curve fitting
analyses to model your data.
-
Data Input:
- Enter your data points manually in the table.
- Add Dataset: Create and manage multiple datasets. Each dataset retains its own data,
uncertainty settings, and fitting results.
- Add Row: Click the "Add Row" button to add an individual data row.
- Clear Data: Remove all data from the active dataset with a single click.
- Copy x₁: Use the "Copy x₁" button to copy all x-values from Dataset 1 into
the active dataset. This feature simplifies workflows when comparing multiple datasets—even if Dataset 1 has
no y values entered.
-
Data Import/Export:
- Import data from a
.csv
file.
- Export your data to
.csv
or .md
(Markdown) formats.
-
Curve Fitting:
- Perform basic fits such as Linear, Quadratic, Cubic, Exponential, and Power.
- Access advanced fitting models such as Sinusoidal and Gaussian.
- Customize initial parameters for advanced fitting methods.
- View fitting equations and R² values.
- Each dataset maintains its own fitting result until a new fit is performed.
-
Graph Visualization:
- Interactive plots powered by Plotly.js.
- Customize the graph title and axis labels.
- LaTeX Mode: A toggle allows you to activate or deactivate LaTeX rendering for all headings,
labels, and titles. When off (default), all text is displayed as plain text. When on, mathematical expressions
are rendered using LaTeX syntax.
- Plot All Datasets: In the combined plot popup you can visualize all datasets
simultaneously. In this view, each dataset’s fitted curve is rendered with its own color, and the header
values (graph title, x-axis, and y-axis labels) correspond to the active dataset but can be further customized
via input boxes.
Getting Started
1. Entering Data
2. Managing Uncertainties
3. Importing and Exporting Data
-
Importing from CSV:
- Click the "Import .csv" button and select a CSV file from your device.
- Ensure that the CSV file has at least two columns for
x
and y
. Additional columns
can represent uncertainties.
-
Exporting Data:
- Click the "Export .csv" button to download your data in CSV format.
- Click the "Export .md" button to download your data in Markdown format, suitable for
documentation or reports.
Note: |
Uncertainties (absolute or percentage) play a crucial role in determining how data is formatted
in the exported .csv and .md files. |
1. Absolute Uncertainties:
The number of decimal places in the exported values matches the precision of the absolute uncertainty.
For example, if the uncertainty is ±0.05 , the corresponding data value will be exported with
two decimal places (e.g., 5.25 ± 0.05 ).
|
2. Percentage Uncertainties:
The precision of exported values is adjusted based on the percentage uncertainty:
- Small uncertainties (≤ 10%): 3 significant figures
- Medium uncertainties (> 10%): 2 significant figures
- Large uncertainties (≥ 50%): 1 significant figure
|
4. Performing Curve Fitting
-
Basic Fit:
- Navigate to the "Basic Fit" tab.
- Select a fitting method (Linear, Quadratic, Cubic, Exponential, Power) from the dropdown.
- Click the "Fit Curve" button to perform the fitting.
- The fitting equation and R² value will be displayed below the graph for the active dataset.
- Click the "Clear Fit" button to remove the fitted curve.
-
Advanced Fit:
- Navigate to the "Advanced Fit" tab.
- Select an advanced fitting method (Sinusoidal, Gaussian) from the dropdown.
- Some initial parameters are calculated based on the imported dataset. Change the initial parameters if
needed.
- Click the "Fit Curve" button to perform the fitting.
- The fitting equation and R² value will be displayed below the graph for the active dataset.
- Click the "Clear Fit" button to remove the fitted curve.
5. Visualizing All Datasets
- Plot All Datasets:
- Click the "Plot All Datasets" button to open a popup displaying a combined plot of all
datasets.
- In the combined plot:
- All datasets are plotted together.
- Each dataset’s fitted curve is drawn in a different color.
- The popup displays input boxes (with labels) for the graph title and axis labels. By default, these
values are taken from the active dataset but can be edited.
- Changes to the title or labels update the combined plot accordingly.
6. LaTeX Mode
- LaTeX Toggle:
- A LaTeX mode toggle is located at the top of the app.
- Default Behavior:
When LaTeX mode is off (the default), all headings,
axis labels, and titles are displayed as plain text.
- Activating LaTeX Mode:
Toggle the switch to on to have your text
rendered using LaTeX formatting (e.g., for complex mathematical expressions). This makes your graphs and
labels appear more professional.
- This setting affects the entire app, including the combined plot view.
Tips and Best Practices
-
Data Quality:
Ensure that your data points are accurate and representative of the
phenomenon you are modeling.
-
Choosing Initial Parameters:
For advanced fitting methods, selecting appropriate initial
parameters can significantly impact the convergence and accuracy of the fit.
-
Uncertainties:
Use uncertainties to account for measurement errors or variability in your
data. Choose between absolute and percentage uncertainties based on your data's nature.
-
LaTeX Formatting:
Enable LaTeX mode when you need high-quality mathematical expressions.
Otherwise, keep it off for improved performance.
Troubleshooting
-
Fitting Did Not Converge:
If a fitting method fails to converge, try adjusting the initial
parameters or selecting a different fitting model.
-
Import Errors:
Ensure that your CSV file is properly formatted with headers and consistent
columns.
-
LaTeX Rendering Issues:
Verify that your LaTeX syntax is correct. If you experience delays,
consider leaving LaTeX mode off.
-
Combined Plot Issues:
- If the combined plot title or axis labels do not match the active dataset, ensure that you switch datasets
and that the combined plot controls are updated accordingly.
- If fitted curves or error bars do not appear as expected, double-check that each dataset's fitting and
uncertainty settings are stored and restored properly.
Happy plotting!