this post was submitted on 12 Dec 2023
5 points (100.0% liked)

LabPlot Data Analysis and Visualization Software

110 readers
2 users here now

KDE's data visualization and analysis software. LabPlot is free, open source, works on Linux, WIndows and macOS, and is accessible to everyone.

Share here your tips, tricks and resources, request help, talk to the maintainers and devs, read LabPlot news, connect with other users.

founded 1 year ago
MODERATORS
 

Did you know that you can work with Jupyter notebooks directly in LabPlot?

@labplot@lemmy.kde.social

For example, let's open the following notebook to see how it works in #labplot

👉 https://github.com/demotu/BMC/blob/master/notebooks/Statistics-Descriptive.ipynb

#DataAnalysis #DataScience #Data #DataViz #Visualization #Plotting #Science #Statistics #FOSS #OpenSource #Python #Jupyter

top 16 comments
sorted by: hot top controversial new old
[–] silmaril@discuss.tchncs.de 1 points 6 months ago (1 children)

That's a great feature, indeed!

I just downloaded this file and opened the notebook in LabPlot. This worked fine in general, but in some places I got errors because of missing packages.

I can see that there is a requirements.txt in the same repo two folders up.

How do I install packages into the environment LabPlot uses? Where can I define a venv for LabPlot? Can I define different venvs for different projects?

[–] LabPlot@floss.social 0 points 6 months ago (1 children)

@silmaril

Working with a custom venv in LabPlot is not possible yet.

[–] silmaril@discuss.tchncs.de 1 points 6 months ago (1 children)

I think it should be quite simple to make this possible.

All we need is a parameter for the python binary path in the CAS Python configuration.

This could be improved further by adding such a parameter to the project, which would override the global value if it is set and which could be a relative path, too. (OK, maybe we would also need some kind of automatism to find the correct binary both on Windows and Linux, because the path from the venv to the acutal python binary is different depending on the system).

[–] LabPlot@floss.social 1 points 6 months ago

@silmaril unfortunately this is more complicated… we’re not communicating with the binary like this is the case for example for Maxima and Octave but embedding the interpreter at runtime. So, our binaries are linked to python’s shared library. This is done at build step and this is the reason why we can only work with the “system version” of Python. This is an important topic that was raised to us already multiple times and we hope we can start working on it in the near future.

[–] silmaril@discuss.tchncs.de 1 points 6 months ago (1 children)

I just looked at the documentation and saw that LabPlot only supports Python 2.x, which makes it entirely uninteresting to me.

I'd love to see support for current Python versions, including following new releases, which might be easier to achieve with 3.x.

But I know this kind of things is a lot of work to get started, so I won't blame anyone for not doing this ;-)

[–] LabPlot@floss.social 1 points 6 months ago (1 children)

@silmaril actually we support Python3 only and the documentation is probably outdated. Where did you read pyrhon2?

[–] silmaril@discuss.tchncs.de 1 points 6 months ago (2 children)

In the help you get when pressing F1 inside LabPlot: https://docs.kde.org/stable5/en/labplot/labplot2/CASworksheet.html

But it's great to hear this info is wrong!

I just tried this in LabPlot:

import sys
print(sys.version)

and the result was

3.11.9 (main, Nov 10 2011, 15:00:00) [GCC 13.2.0]

BTW: What does "CAS" stand for?

[–] silmaril@discuss.tchncs.de 1 points 6 months ago (1 children)

And while we're at it: How does LabPlot decide which python version to use?

On my Linux system, there is no python and python3 points to Python 3.10.12.

LabPlot uses Python 3.11.9 and Python 3.12.2 is also installed.

Which mechanism is used by LabPlot to find the Python version to use? And (how) can I tweak it to make it use 3.12?

[–] LabPlot@floss.social 1 points 6 months ago (1 children)

@silmaril it’s decided at build/compile time. LabPlot is using Cantor internally and when Cantor is being built, the shared libraries of Python that are found in the labrary path are used and linked to. This basically fixes the version of Python used in labplot/cantor.

[–] silmaril@discuss.tchncs.de 1 points 6 months ago (1 children)

Does this mean that as a user of the binary build, I have to install the correct Python version to be used by LabPlot / Cantor on my machine? And the current version will need Python 3.11.x and won’t work if Python 3.12.x is the only version installed?

How can I determine the required Python version from LabPlot in case it’s not already installed?

[–] LabPlot@floss.social 1 points 6 months ago (1 children)

@silmaril this is correct at the moment. Clearly, this not what people want to have usually and we need to change this.

To determine the required version, you can check the dependencies of executable ‘cantor_pyrhonserver’ on Linux either in your package manager or with ldd. For windows we compile and ship everything and document the required version of python in our FAQ.

[–] silmaril@discuss.tchncs.de 1 points 6 months ago (1 children)

Would it be possible to display the Python version and/or it's executable path in the CAS configuration dialog?

That's where I would look for this information and it wouldn't leave any potential for documentation not being up to date.

The FAQ currently states:

On Linux distributions it usually means LabPlot only works with the system version of Python.

What is the "system version"?

On my system python3 --version returns Python 3.10.12, but print(sys.version) in LabPlot returns 3.11.9 (main, Nov 10 2011, 15:00:00) [GCC 13.2.0]

The information about Python versions on Windows seems to be correct, but I would recommend to mention the LabPlot version we are talking about in the FAQ, since this will probably change in future versions.

[–] LabPlot@floss.social 0 points 6 months ago (1 children)

@silmaril "system version" is the version that was used by your system/distribution to link cantor against. We'll re-phrase this part to make it more clear until we have a better and more flexible solution in place.

Yes, showing the version should be possible in the settings dialog. We added this point to our TODO-list.

[–] silmaril@discuss.tchncs.de 1 points 6 months ago (1 children)

Great to hear!

I'd phrase this differently: The "system version" is the version that was used by the build system.

Most users don't build the application themselves, so this is some system they have zero knowledge about, which means this information is not helpful at all.

I understood "your system" as "the system I am using to run this software".

I know this might be hard for developers sometimes, but please try to phrase all documentation (except chapters about actual development, builds etc.) from the user's point of view. Build systems are no part of a typical user's environment ;-)

[–] LabPlot@floss.social 1 points 6 months ago* (last edited 6 months ago)

@silmaril Thank you for your feedback! And let us reiterate here that any help would be greatly appreciated 🙂

[–] LabPlot@floss.social 1 points 6 months ago* (last edited 6 months ago)

@silmaril

"CAS" generally stands for a "Computer Algebra System". It encompasses statistical packages and programming languages like #Maxima, #Octave, #R, #Scilab, #Sage, #KAlgebra, #Qalculate!, #Python, #Julia, #Lua. You can use them all concurrently in multiple #LabPlot's notebooks.

Please, see the attached screenshot. In this case, Python 3.12.3 is available in LabPlot on a Ubuntu machine.