Jump to content

LabPlot/Tutorials/Plotting/PlotTextData: Difference between revisions

From KDE Wiki Sandbox
Asemke (talk | contribs)
No edit summary
Asemke (talk | contribs)
No edit summary
Line 9: Line 9:


2. It is not possible to plot the text data directly in LabPlot. To achieve the desired result we need to add an index column. For this, we add a new column and fill it with row numbers:
2. It is not possible to plot the text data directly in LabPlot. To achieve the desired result we need to add an index column. For this, we add a new column and fill it with row numbers:
 
[[File:LabPlot tutorial plot text data spreadsheet generate index.png |500px|thumb|center]]


3. Now we can plot the numerical values against this index column:
3. Now we can plot the numerical values against this index column:

Revision as of 18:11, 22 March 2023

In this tutorial we're going to show how to plot text data and how to create visualizations like on the plot shown below with numerical data on the y-axis and text data on the x-axis:

This example and the data is taken from the example project "SLOC History" that can be found in the collection of example projects that are part of LabPlot's installation. More background for the data visualized in that example project can be found in the blog post.

1. Let's start with the data:

Here we have one text columns containing the strings representing LabPlot's release versions as well as multiple numerical columns.

2. It is not possible to plot the text data directly in LabPlot. To achieve the desired result we need to add an index column. For this, we add a new column and fill it with row numbers:

3. Now we can plot the numerical values against this index column:

4. The data is properly plotted now and we only need to show the text data in the axis labels. For this, select the x-axis and navigate in the Properties Explorer to the tab "Ticks" and use "Custom Column" for the label type and specify the column "release" from the spreadsheet as the label column:

With this, LabPlot will use the string values from the spreadsheet column to label the axis ticks.