Code Monkey home page Code Monkey logo

scottplot's Introduction

ScottPlot

ScottPlot is a free and open-source graphing library for .NET which makes it easy to display data in a variety of formats (line plots, bar charts, scatter plots, etc.) with just a few lines of code (see the ScottPlot Cookbook for examples). User controls are available for WinForms and WPF to allow interactive display of data.

NuGet Package Target Framework(s) Purpose
ScottPlot .NET Standard 2.0 Plot data and save or return a bitmap
ScottPlot.WinForms .NET Framework 4.6.1
.NET Core 3.0
User control for mouse-interactive plots
ScottPlot.WPF .NET Core 3.0 User control for mouse-interactive plots

ScottPlot 3.1.6 is the last version which supports .NET Framework 4.5

Quickstart

Solution files for quickstart examples are in /doc/quickstart

Static Plot

  • Install the ScottPlot NuGet package
  • Add the following to your startup sequence:
double[] dataX = new double[] {1, 2, 3, 4, 5};
double[] dataY = new double[] {1, 4, 9, 16, 25};
var plt = new ScottPlot.Plot(600, 400);
plt.PlotScatter(dataX, dataY);
plt.SaveFig("quickstart.png");

Static plots can be useful in GUI applications, such as plotting on a Picturebox:

pictureBox1.Image = plt.GetBitmap();

Interactive Plot (Windows Forms)

  • Install the ScottPlot.WinForms NuGet package
  • Drag/drop a FormsPlot user control onto the Form
  • Add the following to the start-up sequence:
double[] dataX = new double[] {1, 2, 3, 4, 5};
double[] dataY = new double[] {1, 4, 9, 16, 25};
wpfPlot1.plt.PlotScatter(dataX, dataY);
formsPlot1.Render();

Interactive Plot (WPF)

  • Install the ScottPlot.WPF NuGet package
  • Add <ScottPlot:WpfPlot Name="wpfPlot1"/> to your XAML file
  • Add the following to the start-up sequence:
double[] dataX = new double[] {1, 2, 3, 4, 5};
double[] dataY = new double[] {1, 4, 9, 16, 25};
wpfPlot1.plt.PlotScatter(dataX, dataY);
wpfPlot1.Render();

Cookbook

Review the ScottPlot Cookbook to see what ScottPlot can do and learn how to use most of the ScottPlot features. Every in figure in the cookbook is displayed next to the code that was used to create it.

Demos

  • Download the demos as a click-to-run EXE: ScottPlotDemos.zip
  • Source code demos is in: /demos
  • The demo project demonstrates advanced topics such as:
    • Animated plots
    • Plotting changing (or growing) data
    • Draggable axis lines
    • Show value on hover
    • Realtime display of audio data (PCM and FFT)

About ScottPlot

ScottPlot was created by Scott Harden (Harden Technologies, LLC) with many contributions from the user community. To inquire about the development special features or customized versions of this software for consumer applications, contact the author at [email protected].

scottplot's People

Contributors

swharden avatar stendprog avatar morningkyle avatar padanian avatar petarpetrovt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.