Repository navigation
Expand file tree
/
Copy pathFigure.cs
More file actions
90 lines (76 loc) · 2.36 KB
/
Copy pathFigure.cs
File metadata and controls
90 lines (76 loc) · 2.36 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
using System.Collections.Generic;
using System.IO;
using MatplotlibCS.PlotItems;
using Newtonsoft.Json;
namespace MatplotlibCS
{
/// <summary>
/// Class desribing a figure to be build
/// </summary>
[JsonObject(Title = "figure")]
public class Figure : IHealthCheck
{
#region ctor
/// <summary>
/// .ctor
/// </summary>
/// <param name="rows">Number of rows in subplots grid</param>
/// <param name="columns">Number of columns in subplots grid</param>
public Figure(int rows = 1, int columns = 1)
{
Rows = rows;
Columns = columns;
Subplots = new List<Axes>();
}
#endregion
#region Properties
/// <summary>
/// Number of rows in subplots grid
/// </summary>
[JsonProperty(PropertyName = "rows")]
public int Rows { get; set; } = 1;
/// <summary>
/// Number of columns in subplots grid
/// </summary>
[JsonProperty(PropertyName = "columns")]
public int Columns { get; set; } = 1;
/// <summary>
/// Figuree subplots
/// </summary>
[JsonProperty(PropertyName = "__subplots__")]
public List<Axes> Subplots { get; set; }
/// <summary>
/// Name or full path of the file where to save result
/// </summary>
[JsonProperty(PropertyName = "filename")]
public string FileName { get; set; }
/// <summary>
/// If true, matplotlib window won't be shown, only image will be saved to disk
/// </summary>
[JsonProperty(PropertyName = "onlySaveImage")]
public bool OnlySaveImage { get; set; }
/// <summary>
/// Dots per inch
/// </summary>
[JsonProperty(PropertyName = "dpi")]
public int DPI { get; set; } = 300;
/// <summary>
/// Image width
/// </summary>
[JsonProperty(PropertyName = "w")]
public int Width { get; set; } = 1920;
/// <summary>
/// Image height
/// </summary>
[JsonProperty(PropertyName = "h")]
public int Height { get; set; } = 1080;
#endregion
public void HealthCheck()
{
foreach (var subplot in Subplots)
{
subplot.HealthCheck();
}
}
}
}