Repository navigation
Expand file tree
/
Copy pathHistogram.cs
More file actions
92 lines (71 loc) · 2.06 KB
/
Copy pathHistogram.cs
File metadata and controls
92 lines (71 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace MatplotlibCS.PlotItems
{
/// <summary>
/// Class describes a histogram
/// </summary>
public class Histogram : PlotItem
{
#region Properties
/// <summary>
/// Data values
/// </summary>
[JsonProperty(PropertyName = "y")]
public List<double> Y { get; set; }
[JsonProperty(PropertyName = "bins")]
public int Bins { get; set; } = 50;
[JsonProperty(PropertyName = "normed")]
public bool Normed { get; set; } = false;
[JsonProperty(PropertyName = "orientation")]
[JsonConverter(typeof(StringEnumConverter))]
public HistogramOrientation Orientation { get; set; } = HistogramOrientation.Vertical;
[JsonProperty(PropertyName = "color")]
public Color Color { get; set; } = Color.Blue;
[JsonProperty(PropertyName = "range")]
public double[] Range { get; set; }
[JsonProperty(PropertyName = "cumulative")]
public bool Cumulative { get; set; }
[JsonProperty(PropertyName = "histtype")]
[JsonConverter(typeof(StringEnumConverter))]
public Histtype Histtype { get; set; }
[JsonProperty(PropertyName = "alpha")]
public double Alpha { get; set; } = 1;
#endregion
#region .ctor
public Histogram(string name) : base(name) { }
#endregion
}
public enum HistogramOrientation
{
[EnumMember(Value = "vertical")]
Vertical,
[EnumMember(Value = "horizontal")]
Horizontal
}
public enum Histtype
{
[EnumMember(Value = "bar")]
Bar,
[EnumMember(Value = "barstacked")]
Barstacked,
[EnumMember(Value = "step")]
Step,
[EnumMember(Value = "stepfilled")]
Stepfilled
}
}
/*
weights=None
bottom=None
histtype='bar'
align='mid'
rwidth=None
log=False
label=None
stacked=False
hold=None
data=None
*/