You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any plans to support XPlot in a C# Console App (not a jupyter notebook)?
I get a plot window, with the following code, but no data is drawn.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Microsoft.ML;
using Microsoft.ML.AutoML;
using Microsoft.ML.Data;
using Microsoft.ML.Featurizers;
using Tensorflow;
using XPlot.Plotly;
namespace BottleRocketClassify {
internal static class Program {
public static class ModelBuilder {
public static void Run() {
var mlContext = new MLContext(seed: 1);
var trainDataView = mlContext.Data.LoadFromTextFile<ModelInput>(
path: @"../../../data/train.csv",
hasHeader: true,
separatorChar: ',');
int numberOfRows = 1000;
var boxRatio =
trainDataView.GetColumn<float>("BoxRatio").Take(numberOfRows).ToArray();
var data = boxRatio.Cast<float>();
var chart = new PlotlyChart();
Chart.Bar(data);
Chart.Show(chart);
}
}
}
}
Charles
The text was updated successfully, but these errors were encountered:
Hi CBrauer, use of XPlot within C# console apps should certainly be supported.
Rather than calling Chart.Show on your newly constructed PlotlyChart, please try the following instead:
Chart.Bar(data).Show();
As a minimal test, the following could be used:
using System.Linq;using XPlot.Plotly;namespaceXPlotTest{classProgram{staticvoidMain(string[]args){vardata= Enumerable.Range(0,100).Select(v =>v+.0);
Chart.Bar(data).Show();}}}
This is to replace Program.cs generated using:
dotnet new console -n XPlotTest
cd XPlotTest
dotnet add package XPlot.Plotly
dotnet add package FSharp.Core
Hey,
Great work on XPlot.
Any plans to support XPlot in a C# Console App (not a jupyter notebook)?
I get a plot window, with the following code, but no data is drawn.
Charles
The text was updated successfully, but these errors were encountered: