helperPlot.jl 2.39 KB
Newer Older
William F Godoy's avatar
William F Godoy committed
1
2
3
4
5
6
7
8
9

import CSV
import DataFrames
using Plots

function plot_CSV_3col( filename::String )
  
  df = CSV.File(filename) |> DataFrames.DataFrame
  
William F Godoy's avatar
William F Godoy committed
10
11
  x = df[!,"plots_cells"]
  y = df[!,"plots_size"]
William F Godoy's avatar
William F Godoy committed
12
    
William F Godoy's avatar
William F Godoy committed
13
  z = df[!,"caseID"]
William F Godoy's avatar
William F Godoy committed
14
  
William F Godoy's avatar
William F Godoy committed
15
  fig1 = Plots.scatter( x, y, groups = z, xaxis=:log, yaxis=:log, 
William F Godoy's avatar
William F Godoy committed
16
                      legendfontsize=7,
William F Godoy's avatar
William F Godoy committed
17
18
19
                      legend = :outertopleft, 
                      # [shapes], size, alpha
                      marker = ([:x :+ :star4 :vline :square :circle], 7, 1.0),
William F Godoy's avatar
William F Godoy committed
20
                      markercolor = [:blue :green :red :orange :pink],
William F Godoy's avatar
William F Godoy committed
21
22
                      xlabel = "cumulative output ncells ( output_counter x ncells )", 
                      ylabel = "cumulative output data size (bytes)", 
William F Godoy's avatar
William F Godoy committed
23
24
25
                      title = "Amrex Castro hydro_test Sedov 2d.cyl_in_cartcoords output size",
                      size=(1200,850),
                      reuse = false
William F Godoy's avatar
William F Godoy committed
26
                      ) 
William F Godoy's avatar
William F Godoy committed
27
28
29
  Plots.gui(fig1)
  #Plots.png(fig1)
  readline()
William F Godoy's avatar
William F Godoy committed
30
31
32
33
34

  yL0 = df[!,3]
  yL1 = df[!,4]
  yL2 = df[!,5]  
  fig2 = Plots.scatter( x, yL0, groups = z, label="L0",
William F Godoy's avatar
William F Godoy committed
35
36
37
38
39
40
41
42
43
44
                          marker = ([:x], 10, 1.0),
                          markercolor = [:blue :green :red :orange :pink],
                          legendfontsize=9,
                          legend = :outertopleft,
                          xlabel = "cumulative output ncells ( output_counter x ncells )", 
                          ylabel = "cumulative output data size (bytes)", 
                          title = "Amrex Castro hydro_test Sedov 2d.cyl_in_cartcoords output size per Level",
                          size=(1200,850),
                          reuse = true
                          )
William F Godoy's avatar
William F Godoy committed
45
  Plots.scatter!( x, yL1, groups = z, label= "L1", 
William F Godoy's avatar
William F Godoy committed
46
47
48
49
                          marker = ([:+], 10, 1.0),
                          markercolor = [:blue :green :red :orange :pink],
                           )
                            
William F Godoy's avatar
William F Godoy committed
50
  Plots.scatter!( x, yL2, groups = z, label="L2", 
William F Godoy's avatar
William F Godoy committed
51
52
53
54
55
                          marker = ([:star4], 10, 1.0),
                          markercolor = [:blue :green :red :orange :pink],
                          )
  Plots.gui(fig2)
  #Plots.png(fig2)
William F Godoy's avatar
William F Godoy committed
56
57
58
59
60
61
62
63
64
  readline()
  
end



function main()

  # modify this to the file path
William F Godoy's avatar
William F Godoy committed
65
66
  filename = "/home/wgodoy/hdd_home/work/proxy_io/AmrexCastro/plot_size.csv"
  # filename = "/home/wgodoy/hdd_home/work/proxy_io/AmrexCastro/plot_size_case4.csv"
William F Godoy's avatar
William F Godoy committed
67
68
69
70
71
  plot_CSV_3col(filename)
end

main()