-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plot.m
101 lines (86 loc) · 3.09 KB
/
Plot.m
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
93
94
95
96
97
98
99
100
101
//
// Plot.m
// CocoaNXYPlot
//
// Created by Roberto Abraham on Sun Aug 18 2002.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import "Plot.h"
@implementation Plot
+(void) initialize
{
if (self==[Plot class]){
[self setVersion:1];
}
}
- (id)init {
self = [super init];
if (self) {
[self setShouldDrawFrameBox:YES];
[self setShouldDrawGrid:YES];
[self setShouldDrawAxes:YES];
[self setShouldDrawMajorTicks:YES];
[self setShouldDrawMinorTicks:YES];
[self setShouldDrawData:YES];
[self setTickMarkLength:2.0];
[self setTickMarkLocation:2];
[self setTickMarkThickness:1.0];
[self setGridThickness:1.0];
[self setIsGridDotted:NO];
[self setXMin:10.0];
[self setXMax:100.0];
[self setXMajorIncrement:10.0];
[self setXMinorIncrement:2.0];
[self setIsXLogarithmic:NO];
[self setYMin:10.0];
[self setYMax:100.0];
[self setYMajorIncrement:10.0];
[self setYMinorIncrement:2.0];
[self setIsYLogarithmic:NO];
[self setPlotData:[[NSMutableArray alloc] init]];
}
return self;
}
//Accessor macros
idAccessor(plotData,setPlotData)
boolAccessor(shouldDrawFrameBox,setShouldDrawFrameBox)
boolAccessor(shouldDrawGrid,setShouldDrawGrid)
boolAccessor(shouldDrawAxes,setShouldDrawAxes)
boolAccessor(shouldDrawMajorTicks,setShouldDrawMajorTicks)
boolAccessor(shouldDrawMinorTicks,setShouldDrawMinorTicks)
boolAccessor(shouldDrawData,setShouldDrawData)
floatAccessor(tickMarkLength,setTickMarkLength)
intAccessor(tickMarkLocation,setTickMarkLocation)
floatAccessor(tickMarkThickness,setTickMarkThickness)
floatAccessor(gridThickness,setGridThickness)
boolAccessor(isGridDotted,setIsGridDotted)
floatAccessor(xMin,setXMin)
floatAccessor(xMax,setXMax)
floatAccessor(xMajorIncrement,setXMajorIncrement)
floatAccessor(xMinorIncrement,setXMinorIncrement)
boolAccessor(isXLogarithmic,setIsXLogarithmic)
floatAccessor(yMin,setYMin)
floatAccessor(yMax,setYMax)
floatAccessor(yMajorIncrement,setYMajorIncrement)
floatAccessor(yMinorIncrement,setYMinorIncrement);
boolAccessor(isYLogarithmic,setIsYLogarithmic)
intAccessor(xNumberFormatLeft,setXNumberFormatLeft)
intAccessor(xNumberFormatRight,setXNumberFormatRight)
intAccessor(xNumberFormatExponent,setXNumberFormatExponent)
intAccessor(yNumberFormatLeft,setYNumberFormatLeft)
intAccessor(yNumberFormatRight,setYNumberFormatRight)
intAccessor(yNumberFormatExponent,setYNumberFormatExponent)
boolAccessor(shouldHandFormatXAxis,setShouldHandFormatXAxis)
boolAccessor(shouldHandFormatYAxis,setShouldHandFormatYAxis)
intAccessor(xTickLabelWidth,setXTickLabelWidth)
intAccessor(yTickLabelWidth,setYTickLabelWidth)
idAccessor(backgroundColor,setBackgroundColor)
idAccessor(textColor,setTextColor)
idAccessor(curveColors,CurveColors)
idAccessor(xAxisTickFont,setXAxisTickFont)
idAccessor(yAxisTickFont,setYAxisTickFont)
idAccessor(xAxisLabelFont,setXAxisLabelFont)
idAccessor(yAxisLabelFont,setYAxisLabelFont)
idAccessor(plotTitleFont,setPlotTitleFont)
idAccessor(legendFont,setLegendFont)
@end