nu_plugin_nuplot

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2025 License: BSD-2-Clause Imports: 9 Imported by: 0

README

nuplot

nuplot is a nushell plugin for plotting charts. It builds interactive charts from your data that are opened inside the web browser.

Features

  • Supported chart types:
    • Line chart
    • Bar chart
    • Stacked bar chart
    • Pie chart
    • Boxplot chart
    • Kline chart
  • Chart title, size and color theme can be adjusted
  • Configure, which series is used for the x-axis

Examples

A Simple Pie chart
{'apples': 7 'oranges': 5 'bananas': 3} | nuplot pie --title "Fruits"

Fruits

Show weather forcast from wttr.in as bar chart
http get http://wttr.in?format=j1
| get weather
| select date avgtempC
| each {|l| {date: ($l.date | into datetime) avgtempC: ($l.avgtempC | into int)} }
| nuplot bar --xaxis date --title "Weather forcast"

The data type conversion for avgtempC is needed, because nuplot only shows series of numbers. The data type conversion of the date column can be omitted but will lead to warnings in the moment because the date format is not recognized correctly.

Weather forcast (1)

Show the average monthly temperatures as a boxplot chart
http get https://bulk.meteostat.net/v2/hourly/2024/10389.csv.gz
| gunzip
| from csv --noheaders
| select column0 column2
| rename date temperature
| upsert date {|l| $l.date | format date "%B"}
| chunk-by {$in.date}
| nuplot boxplot --xaxis date --title "Average monthly temperatures for 2024 in Berlin"

image

Getting binaries

Binaries for a range of operating systems and architectures are provided with each release on GitHub. Simply download the zip file for your os and architecture.

Build from source

Prerequisits: You will need the Go compiler to build the project.

Check out the project

git clone https://github.com/gtnebel/nu_plugin_nuplot.git

Build the project

go build

Register the plugin an nushell

Use the plugin add and plugin use commands to register and use the plugin.

The plugin use command is only needed to activate the newly added plugin in the currently running shell.

plugin add nu_plugin_nuplot
plugin use nuplot;

Now, help nuplot line should show the help for the line chart.

Acknowledgments

This software is using other great open source libraries:

Additional dependencies

BSD 2-Clause License

Copyright (c) 2025, Thomas Nebel

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Documentation

Overview

nu_plugin_nuplot is a [Nushell](https://nushell.sh/) plugin for plotting charts. It builds interactive charts from your data that are opened inside the web browser.

Directories

Path Synopsis
This package holds all plugin subcommands along with common data types and functions used by all subcommands.
This package holds all plugin subcommands along with common data types and functions used by all subcommands.
flags
This package holds the flags used in all subcommands.
This package holds the flags used in all subcommands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL