๋ฐ˜์‘ํ˜•

์†Œ๊ฐœ

ํ”„๋กœ๊ทธ๋žจ์„ ๊ฐœ๋ฐœํ•˜๋‹ค ๋ณด๋ฉด ๊บพ์€์„  ๊ทธ๋ž˜ํ”„๋‚˜ ์›ํ˜• ์ฐจํŠธ์™€ ๊ฐ™์€ UI ์ปดํฌ๋„ŒํŠธ๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. MFC์—์„œ๋Š” ๊บพ์€์„  ๊ทธ๋ž˜ํ”„๋ฅผ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•ด ์ง์ ‘ GDI+๋กœ ๊ฐœ๋ฐœํ•œ ๊ฒฝํ—˜์ด ์žˆ๋Š”๋ฐ์š”. ์†”์งํžˆ UI ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ง์ ‘ ๋งŒ๋“ค ์ˆ˜๋Š” ์žˆ์ง€๋งŒ, ์—ฌ๊ธฐ์— ์‹œ๊ฐ„์„ ํˆฌ์žํ•˜๋Š” ๊ฒƒ์€ ๋น„ํšจ์œจ์ ์ด๋ผ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌ๋‹ค ๋ฉ”์ธ ํ”„๋กœ๊ทธ๋žจ ๊ฐœ๋ฐœ ๊ธฐ๊ฐ„๋งŒ ๋Š˜์–ด๋‚˜๊ธฐ ๋•Œ๋ฌธ์ด์ฃ .

๊ทธ๋Ÿฐ๋ฐ ์ด์™€ ๋ฐ˜๋Œ€๋กœ C#์€ ๋ฌด๋ฃŒ UI ์ปดํฌ๋„ŒํŠธ๋ฅผ ๊ตฌํ•˜๊ธฐ๊ฐ€ ์•„์ฃผ ์‰ฝ์Šต๋‹ˆ๋‹ค. ์›ฌ๋งŒํ•œ ๊ฑด Nuget์—์„œ ์•„์ฃผ ์‰ฝ๊ฒŒ ์ฐพ์„ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด์ฃ . ์ฐจํŠธ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€์ž…๋‹ˆ๋‹ค. ScottPlot ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ๋ˆ„๊ฒŸ์—์„œ ์„ค์น˜ํ•˜๊ณ  ๋ฐ”๋กœ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

ScottPlot ๋ฐ๋ชจ. ์ถœ์ฒ˜: ScottPlot GitHub
ScottPlot ๋ฐ๋ชจ. ์ถœ์ฒ˜: ScottPlot GitHub

ScottPlot ํŠน์ง•

  • ๋ฌด๋ฃŒ๋กœ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅ(MIT License)
  • Windows Forms, WPF ๋ชจ๋‘ ์ง€์›
  • ๋‹ค์–‘ํ•œ ์ฐจํŠธ ์ง€์›(Bar, Bubble, Coxcomb, Curve, Finance, Pie, Polygon ๋“ฑ ๋‹ค์ˆ˜)
  • ๋งˆ์šฐ์Šค ๋ฐ ํ‚ค๋ณด๋“œ ์ƒํ˜ธ ๋™์ž‘
  • ์‚ฌ์šฉ์ž ํŽธ์˜๋ฅผ ์œ„ํ•œ Demo Program๊ณผ Quick Start Cookbook์„ ์ œ๊ณตํ•˜์—ฌ ๋น ๋ฅธ ๊ฐœ๋ฐœ ๊ฐ€๋Šฅ

์ œ๊ฐ€ ์‚ฌ์šฉํ•ด ๋ณด๋ฉด์„œ ๋Š๋‚€ ์žฅ์ ๋“ค์„ ๋‚˜์—ดํ•ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค. ์•„๋งˆ ์ด ์™ธ์—๋„ ํŠน์ง•์ด ๋” ์žˆ์„ ํ…๋ฐ์š”. ์œ„ ํŠน์ง• ์ค‘ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ์ ์€ '๋ฌด๋ฃŒ'์ธ ๊ฒƒ๊ณผ 'Demo Program' ๋ฐ 'Quick Start Cookbook'์ด๋ผ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ๋‚˜ ์ข‹์€ ์ฐจํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋ฌด๋ฃŒ๋กœ ์ œ๊ณตํ–ˆ๋‹ค๋Š” ์ ์— ์•„์ฃผ ๋†€๋ผ์› ์Šต๋‹ˆ๋‹ค. ๊ฒŒ๋‹ค๊ฐ€ ์‚ฌ์šฉ์ž์˜ ํŽธ์˜๋ฅผ ์œ„ํ•ด ๋ชจ๋“  ์ฐจํŠธ์˜ ๋ฐ๋ชจ ํ”„๋กœ๊ทธ๋žจ๊ณผ Quick Start Cookbook์„ ์ œ๊ณตํ•˜์—ฌ ์†Œ์Šค ์˜ˆ์ œ๋„ ์‰ฝ๊ฒŒ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ๋„ˆ๋ฌด๋‚˜๋„ ์นœ์ ˆํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ์ •๋ง ์˜ค๋žœ๋งŒ์— ๋ณธ ๋“ฏํ•˜๋„ค์š”.

ScottPlot Cookbook
ScottPlot Cookbook

https://scottplot.net/cookbook/4.1/

 

ScottPlot 4.1 Cookbook

Images created with ScottPlot 4.1 shown next to the code used to create them.

scottplot.net

ScottPlot ๋ฐ๋ชจ ํ”„๋กœ๊ทธ๋žจ์œผ๋กœ ๊ฒ€ํ† ํ•˜๊ธฐ

์•„๋ž˜ ScottPlot Demo ํŽ˜์ด์ง€์— ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค.

https://scottplot.net/demo/

 

ScottPlot Demo Application

A click-to-run application designed to make it easy to assess the capabilities of ScottPlot

scottplot.net

์œ„ ์‚ฌ์ดํŠธ์— ์ ‘์†ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์ขŒ์ธก์˜ Windows Forms ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ๋ฐ๋ชจ ํ”„๋กœ๊ทธ๋žจ์„ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

๋ฐ๋ชจ ํ”„๋กœ๊ทธ๋žจ ๋‹ค์šด๋กœ๋“œ ํ™”๋ฉด
๋ฐ๋ชจ ํ”„๋กœ๊ทธ๋žจ ๋‹ค์šด๋กœ๋“œ ํ™”๋ฉด

๋‹ค์šด๋กœ๋“œํ•œ ์••์ถ• ํŒŒ์ผ์„ ํ•ด์ œํ•œ ํ›„ ScottPlot.Demo.WinForms.exe ํŒŒ์ผ์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

ScottPlot Demo ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰ ํ™”๋ฉด
ScottPlot Demo ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰ ํ™”๋ฉด

Launch ScottPlot Cookbook ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๋ชจ๋“  Plot์˜ ๊ธฐ๋Šฅ๊ณผ ์„ค๋ช…, ์†Œ์Šค ์ฝ”๋“œ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์›ํ•˜๋Š” ํ”Œ๋กฏ์ด ์ง€์›๋˜๋Š”์ง€, ์ง€์›๋œ๋‹ค๋ฉด ์–ด๋–ค ๋™์ž‘์„ ์˜ˆ์ƒํ•˜๊ณ  ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ•˜๋Š”์ง€ ๋ฏธ๋ฆฌ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐœ๋ฐœ์ž๊ฐ€ ์ •๋ง ์„ธ์‹ฌํ•˜๊ฒŒ ์‹ ๊ฒฝ ์ผ๋‹ค๋Š” ๊ฒƒ์ด ๋Š๊ปด์ง‘๋‹ˆ๋‹ค.

ScottPlot Cookbook Demo ํ™”๋ฉด
ScottPlot Cookbook Demo ํ™”๋ฉด

๊ทธ ์™ธ์˜ Plot ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด, ์ง์ ‘ ์ปจํŠธ๋กคํ•˜์—ฌ Plot์˜ ๋™์ž‘์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Plot in a Scroll Viewer ๋™์ž‘ ํ™”๋ฉด
Plot in a Scroll Viewer ๋™์ž‘ ํ™”๋ฉด

WinForm์—์„œ ScottPlot ์ค€๋น„ํ•˜๊ธฐ

Windows Forms ์•ฑ(.NET Framework) ํ”„๋กœ์ ํŠธ๋ฅผ ExamScottPlot ์ด๋ฆ„์œผ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

Windows Forms ์•ฑ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑํ•˜๊ธฐ
Windows Forms ์•ฑ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑํ•˜๊ธฐ

NuGet์—์„œ ScottPlot์„ ๊ฒ€์ƒ‰ํ•˜๊ณ , ScottPlot.WinForms๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

NuGet์—์„œ ScottPlot ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ
NuGet์—์„œ ScottPlot ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ

์„ค์น˜ํ•  ํ”„๋กœ์ ํŠธ๋ฅผ ์„ ํƒํ•˜๊ณ  ์„ค์น˜ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

ScottPlot์„ ํ”„๋กœ์ ํŠธ์— ์„ค์น˜ํ•˜๊ธฐ
ScottPlot์„ ํ”„๋กœ์ ํŠธ์— ์„ค์น˜ํ•˜๊ธฐ

์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์ด ํ”„๋กœ์ ํŠธ ์ฐธ์กฐ์— ScottPlot๊ณผ ScottPlot.WinForms์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

ํ”„๋กœ์ ํŠธ ์ฐธ์กฐ dll
ํ”„๋กœ์ ํŠธ ์ฐธ์กฐ dll

๊ทธ๋ฆฌ๊ณ  ๋„๊ตฌ ์ƒ์ž์— ์•„๋ž˜์™€ ๊ฐ™์ด FormsPlot์ด๋ผ๋Š” ์ปดํฌ๋„ŒํŠธ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

FormsPlot ์ปดํฌ๋„ŒํŠธ
FormsPlot ์ปดํฌ๋„ŒํŠธ

WinForm์—์„œ Scatter Plot ๋งŒ๋“ค๊ธฐ

์ปจํŠธ๋กค์„ ํผ์— ์ถ”๊ฐ€ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

ํผ์— ์ถ”๊ฐ€๋œ ๋ชจ์Šต
ํผ์— ์ถ”๊ฐ€๋œ ๋ชจ์Šต

ScottPlot demo ์ค‘ 'Scatter Plot Quickstart'๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์ƒ์„ฑํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์— ํ‘œ์‹œํ•œ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๊ทธ๋Œ€๋กœ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

Quick Start ์ฝ”๋“œ ์˜ˆ์‹œ
Quick Start ์ฝ”๋“œ ์˜ˆ์‹œ

์ฝ”๋“œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ScottPlot; //์ถ”๊ฐ€

namespace ExamScottPlot
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnInitialize_Click(object sender, EventArgs e)
        {
            int pointCount = 51;
            double[] x = DataGen.Consecutive(pointCount);
            double[] sin = DataGen.Sin(pointCount);
            double[] cos = DataGen.Cos(pointCount);

            scatterPlot.Plot.AddScatter(x, sin);
            scatterPlot.Plot.AddScatter(x, cos);

            scatterPlot.Refresh();
        }
    }
}

๋™์ž‘ ๊ฒฐ๊ณผ๋ฅผ ๋ณผ๊นŒ์š”? ๋ฐ๋ชจ ๋™์ž‘์ด๋ž‘ ๋™์ผํ•˜๊ฒŒ ์›€์ง์ž…๋‹ˆ๋‹ค. ์ฝ”๋“œ ๋‚ด์šฉ๋„ ์•„์ฃผ ๊ฐ„๋‹จํ•˜์ฃ ? 51๊ฐœ์˜ X์ถ• ๋ฐ์ดํ„ฐ์™€, X์ถ•์— ๋Œ€์‘๋˜๋Š” sin, cos ๊ฐ’์„ double ๋ฐฐ์—ด๋กœ ๋ฐ›์•„๋„˜๊ฒจ๋งŒ ์ฃผ๋ฉด ๋์ž…๋‹ˆ๋‹ค.

Scatter Plot ์˜ˆ์ œ
Scatter Plot ์˜ˆ์ œ

์‚ฌ์šฉ ๋ฐฉ๋ฒ•์ด ์ฐธ ๊ฐ„๋‹จํ•˜์ฃ ? ์ž์„ธํ•œ ์‚ฌ์šฉ ๋ฐฉ๋ฒ•์€ ์•„๋ž˜ ์˜ˆ์ œ ์ฝ”๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

ExamScottPlot.zip
4.49MB

๋ฐ˜์‘ํ˜•