Skip to content

Commit a999e8e

Browse files
committed
setting ticks
1 parent 3f15edb commit a999e8e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

timing/timing_individual_function.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,15 @@ def plot_timing_heatmap(targetFunc):
148148

149149
# Plot the heatmap with performance speedup values
150150
plt.figure(figsize=(20, 4))
151-
hm = sns.heatmap(
151+
sns.heatmap(
152152
data=speedup_df.T, annot=heatmap_annot.T, fmt="", cmap="RdYlGn", cbar=True
153153
)
154154

155-
# Set tick labels for y-axis (edge probabilities) and x-axis (number of nodes)
156-
hm.set_xticklabels(number_of_nodes)
157-
hm.set_yticklabels(edge_prob)
155+
plt.xticks(
156+
ticks=np.arange(len(number_of_nodes)) + 0.5, labels=number_of_nodes, rotation=45
157+
)
158+
plt.yticks(ticks=np.arange(len(edge_prob)) + 0.5, labels=edge_prob, rotation=20)
158159

159-
# Improve readability by rotating axis tick labels
160-
plt.xticks(rotation=45)
161-
plt.yticks(rotation=20)
162160
plt.title(
163161
"Small Scale Demo: Times Speedups of "
164162
+ targetFunc.__name__
@@ -171,4 +169,4 @@ def plot_timing_heatmap(targetFunc):
171169
plt.savefig("timing/" + "heatmap_" + targetFunc.__name__ + "_timing.png")
172170

173171

174-
# plot_timing_heatmap(nx.algorithms.centrality.betweenness.betweenness_centrality)
172+
# plot_timing_heatmap(nx.algorithms.tournament.is_reachable)

0 commit comments

Comments
 (0)