-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #319 from opencompl/christos/add-plotting-scripts
Add plotting scripts from paper for artifact reproduction
- Loading branch information
Showing
24 changed files
with
1,714 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"axis": { | ||
"xlabel": { | ||
"label": "" | ||
}, | ||
"ylabel": { | ||
"label": "Cycles", | ||
"rotation": "horizontal", | ||
"position": [1.0, 1.05], | ||
"horizontalalignment": "left", | ||
"verticalalignment": "bottom" | ||
}, | ||
"ylim": [ | ||
0, | ||
5000 | ||
], | ||
"xticks": { | ||
"labelrotation": 45 | ||
} | ||
}, | ||
"legend": { | ||
"ncol": 50, | ||
"bbox_to_anchor": [0, 1, 1, 0], | ||
"loc": "lower right" | ||
}, | ||
"spines" : { | ||
"left": { | ||
"color": "black", | ||
"linewidth": 0.4 | ||
}, | ||
"bottom": { | ||
"color": "black", | ||
"linewidth": 0.4 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# vim: ft=config | ||
|
||
## Use TrueType fonts instead of Type 3 fonts | ||
# | ||
# Type 3 fonts embed bitmaps and are not allowed in camera-ready submissions | ||
# for many conferences. TrueType fonts look better and are accepted. | ||
# This follows: https://www.conference-publishing.com/Help.php | ||
pdf.fonttype: 42 | ||
ps.fonttype: 42 | ||
|
||
font.size: 12 | ||
#font.family: serif | ||
font.family: sans-serif | ||
#font.sans-serif: ["Helvetica"] | ||
|
||
text.usetex: False | ||
|
||
## Enable tight_layout by default | ||
# | ||
# This ensures the plot has always sufficient space for legends, ... | ||
# Without this sometimes parts of the figure would be cut off. | ||
figure.autolayout: True | ||
|
||
#figure.figsize: 3, 2.5 | ||
figure.figsize: 4, 2.5 | ||
|
||
legend.frameon: False | ||
legend.fontsize: 8 | ||
legend.loc: upper right | ||
legend.fancybox: False | ||
legend.framealpha: 1.0 | ||
legend.shadow: False | ||
legend.borderaxespad: 0 | ||
legend.edgecolor: gray | ||
legend.handleheight: 1 | ||
legend.labelspacing: 0.2 | ||
legend.columnspacing: 0.4 | ||
legend.handletextpad: 0.2 | ||
|
||
patch.edgecolor: black | ||
patch.force_edgecolor: False | ||
patch.linewidth: 0.4 | ||
|
||
xtick.top: False | ||
xtick.bottom: True | ||
xtick.major.size: 3 | ||
xtick.major.width: 0.4 | ||
|
||
ytick.left: True | ||
ytick.right: False | ||
ytick.direction: out | ||
ytick.major.size: 3 | ||
ytick.major.width: 0.4 | ||
|
||
axes.grid.axis: y | ||
axes.grid: True | ||
|
||
# Hide the right and top spines | ||
# | ||
# This reduces the number of lines in the plot. Lines typically catch | ||
# a readers attention and distract the reader from the actual content. | ||
# By removing unnecessary spines, we help the reader to focus on | ||
# the figures in the graph. | ||
axes.spines.right: False | ||
axes.spines.top: False | ||
|
||
grid.color: black | ||
grid.alpha: 0.2 | ||
grid.linewidth: 0.4 | ||
grid.linestyle: dotted | ||
|
||
|
||
savefig.bbox: tight | ||
savefig.pad_inches: 0.05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"axis": { | ||
"xlabel": { | ||
"label": "" | ||
}, | ||
"ylabel": { | ||
"label": "Cycles", | ||
"rotation": "horizontal", | ||
"position": [1.0, 1.05], | ||
"horizontalalignment": "left", | ||
"verticalalignment": "bottom" | ||
}, | ||
"ylim": [ | ||
0, | ||
5000 | ||
], | ||
"xticks": { | ||
"labelrotation": 0 | ||
} | ||
}, | ||
"legend": { | ||
"ncol": 50, | ||
"bbox_to_anchor": [0, 1, 1, 0], | ||
"loc": "lower right" | ||
}, | ||
"spines" : { | ||
"left": { | ||
"color": "black", | ||
"linewidth": 0.4 | ||
}, | ||
"bottom": { | ||
"color": "black", | ||
"linewidth": 0.4 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# vim: ft=config | ||
|
||
## Use TrueType fonts instead of Type 3 fonts | ||
# | ||
# Type 3 fonts embed bitmaps and are not allowed in camera-ready submissions | ||
# for many conferences. TrueType fonts look better and are accepted. | ||
# This follows: https://www.conference-publishing.com/Help.php | ||
pdf.fonttype: 42 | ||
ps.fonttype: 42 | ||
|
||
font.size: 12 | ||
#font.family: serif | ||
font.family: sans-serif | ||
#font.sans-serif: ["Helvetica"] | ||
|
||
text.usetex: False | ||
|
||
## Enable tight_layout by default | ||
# | ||
# This ensures the plot has always sufficient space for legends, ... | ||
# Without this sometimes parts of the figure would be cut off. | ||
figure.autolayout: True | ||
|
||
#figure.figsize: 3, 2.5 | ||
figure.figsize: 3, 2 | ||
|
||
legend.frameon: False | ||
legend.fontsize: 8 | ||
legend.loc: upper right | ||
legend.fancybox: False | ||
legend.framealpha: 1.0 | ||
legend.shadow: False | ||
legend.borderaxespad: 0 | ||
legend.edgecolor: gray | ||
legend.handleheight: 1 | ||
legend.labelspacing: 0.2 | ||
legend.columnspacing: 0.4 | ||
legend.handletextpad: 0.2 | ||
|
||
patch.edgecolor: black | ||
patch.force_edgecolor: False | ||
patch.linewidth: 0.4 | ||
|
||
xtick.top: False | ||
xtick.bottom: True | ||
xtick.major.size: 3 | ||
xtick.major.width: 0.4 | ||
|
||
ytick.left: True | ||
ytick.right: False | ||
ytick.direction: out | ||
ytick.major.size: 3 | ||
ytick.major.width: 0.4 | ||
|
||
axes.grid.axis: y | ||
axes.grid: True | ||
|
||
# Hide the right and top spines | ||
# | ||
# This reduces the number of lines in the plot. Lines typically catch | ||
# a readers attention and distract the reader from the actual content. | ||
# By removing unnecessary spines, we help the reader to focus on | ||
# the figures in the graph. | ||
axes.spines.right: False | ||
axes.spines.top: False | ||
|
||
grid.color: black | ||
grid.alpha: 0.2 | ||
grid.linewidth: 0.4 | ||
grid.linestyle: dotted | ||
|
||
|
||
savefig.bbox: tight | ||
savefig.pad_inches: 0.05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# vim: ft=config | ||
|
||
## Use TrueType fonts instead of Type 3 fonts | ||
# | ||
# Type 3 fonts embed bitmaps and are not allowed in camera-ready submissions | ||
# for many conferences. TrueType fonts look better and are accepted. | ||
# This follows: https://www.conference-publishing.com/Help.php | ||
pdf.fonttype: 42 | ||
ps.fonttype: 42 | ||
|
||
font.size: 12 | ||
#font.family: serif | ||
font.family: sans-serif | ||
#font.sans-serif: ["Helvetica"] | ||
|
||
text.usetex: False | ||
|
||
## Enable tight_layout by default | ||
# | ||
# This ensures the plot has always sufficient space for legends, ... | ||
# Without this sometimes parts of the figure would be cut off. | ||
figure.autolayout: True | ||
|
||
#figure.figsize: 3, 2.5 | ||
#figure.figsize: 4, 2.5 | ||
|
||
legend.frameon: False | ||
legend.fontsize: 14 | ||
legend.loc: upper center | ||
legend.fancybox: False | ||
legend.framealpha: 1.0 | ||
legend.shadow: False | ||
legend.borderaxespad: 0 | ||
legend.edgecolor: gray | ||
legend.handleheight: 1 | ||
legend.labelspacing: 0.1 | ||
legend.columnspacing: 0.8 | ||
legend.handletextpad: 0.1 | ||
|
||
xtick.top: False | ||
xtick.bottom: True | ||
xtick.major.size: 3 | ||
xtick.major.width: 0.4 | ||
|
||
ytick.left: True | ||
ytick.right: False | ||
ytick.direction: out | ||
ytick.major.size: 3 | ||
ytick.major.width: 0.4 | ||
|
||
axes.grid.axis: y | ||
axes.grid: True | ||
|
||
# Hide the right and top spines | ||
# | ||
# This reduces the number of lines in the plot. Lines typically catch | ||
# a readers attention and distract the reader from the actual content. | ||
# By removing unnecessary spines, we help the reader to focus on | ||
# the figures in the graph. | ||
axes.spines.right: False | ||
axes.spines.top: False | ||
|
||
grid.color: black | ||
grid.alpha: 0.2 | ||
grid.linewidth: 0.4 | ||
grid.linestyle: dashed | ||
|
||
|
||
savefig.bbox: tight | ||
savefig.pad_inches: 0.02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from typing import Iterable, Sequence, cast | ||
import pandas as pd | ||
import numpy as np | ||
import numpy.typing as npt | ||
from plot_utils import IMPL_COLORS, IMPL_MARKERS, plot_combined, GridPlotRow | ||
from matplotlib.axes import Axes | ||
|
||
from math import log10, ceil, floor | ||
|
||
|
||
class CyclesGridPlotRow(GridPlotRow): | ||
ylabel = "Cycles" | ||
|
||
@classmethod | ||
def yrange(cls, dfs: Sequence[pd.DataFrame]) -> npt.NDArray[np.float64]: | ||
max_value = cast(float, max(_df.max().iloc[0] for _df in dfs)) | ||
magnitude: float = 10 ** floor(log10(max_value)) | ||
greater_round_number = ceil(max_value / magnitude) * magnitude | ||
yrange = np.arange(0, greater_round_number + 1, greater_round_number // 10) | ||
return yrange | ||
|
||
@classmethod | ||
def plot_grid_cell( | ||
cls, | ||
ax: Axes, | ||
df: pd.DataFrame, | ||
*, | ||
hide_xlabel: bool, | ||
) -> None: | ||
for col in df: | ||
ax.scatter( | ||
x=df.index, | ||
y=df[col], | ||
color=IMPL_COLORS[col], | ||
marker=IMPL_MARKERS[col], | ||
) | ||
ax.set_xticks(df.index) | ||
if not hide_xlabel: | ||
ax.set_xlabel(df.index.name, fontsize=12) | ||
|
||
|
||
def plot_cycles(cycles_dfs: tuple[pd.DataFrame, ...]): | ||
return plot_combined( | ||
CyclesGridPlotRow.get_rows(cycles_dfs, 4), | ||
legend_cols=3, | ||
rcparams_cfg_file="config/gridplot.mplstyle", | ||
) |
Oops, something went wrong.