Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
eicplot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
EIC
eicplot
Commits
1dbe4073
Commit
1dbe4073
authored
Apr 13, 2018
by
David Blyth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackres: plot and scale now in same image
parent
d536330d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
trackres/main.go
trackres/main.go
+20
-4
No files found.
trackres/main.go
View file @
1dbe4073
...
...
@@ -13,7 +13,8 @@ import (
"gonum.org/v1/plot"
"gonum.org/v1/plot/palette/moreland"
"gonum.org/v1/plot/plotter"
"gonum.org/v1/plot/vg"
"gonum.org/v1/plot/vg/draw"
"gonum.org/v1/plot/vg/vgimg"
"github.com/decibelcooper/eicplot"
)
...
...
@@ -118,15 +119,21 @@ func main() {
reader
.
Close
()
img
:=
vgimg
.
New
(
670
,
400
)
dc
:=
draw
.
New
(
img
)
dc0
:=
draw
.
Crop
(
dc
,
0
,
-
70
,
0
,
0
)
dc1
:=
draw
.
Crop
(
dc
,
620
,
0
,
0
,
0
)
colorMap
:=
moreland
.
ExtendedBlackBody
()
colorMap
.
SetMin
(
0
)
colorMap
.
SetMax
(
0.05
)
heatMap
:=
plotter
.
NewHeatMap
(
resGrid
,
colorMap
.
Palette
(
1000
))
pal
:=
colorMap
.
Palette
(
1000
)
heatMap
:=
plotter
.
NewHeatMap
(
resGrid
,
pal
)
heatMap
.
Min
=
0
heatMap
.
Max
=
0.05
p
.
Add
(
heatMap
)
p
.
Save
(
6
*
vg
.
Inch
,
4
*
vg
.
Inch
,
*
output
)
p
.
Draw
(
dc0
)
p
,
_
=
plot
.
New
()
...
...
@@ -136,7 +143,16 @@ func main() {
p
.
HideX
()
p
.
Y
.
Padding
=
0
p
.
Save
(
50
,
400
,
"scale.png"
)
p
.
Draw
(
dc1
)
w
,
err
:=
os
.
Create
(
*
output
)
if
err
!=
nil
{
log
.
Panic
(
err
)
}
png
:=
vgimg
.
PngCanvas
{
Canvas
:
img
}
if
_
,
err
=
png
.
WriteTo
(
w
);
err
!=
nil
{
log
.
Panic
(
err
)
}
}
type
ResGrid
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment