Skip to content
Snippets Groups Projects
Commit d78d6c9c authored by dimitri.lizzi's avatar dimitri.lizzi
Browse files

svg bar charts: remove date metadata with latest matplotlib version

parent f46e0d3b
Branches
No related tags found
No related merge requests found
Showing
with 29 additions and 27 deletions
doc/charts/chart_deploy_time_debian.png

130 B | W: | H:

doc/charts/chart_deploy_time_debian.png

130 B | W: | H:

doc/charts/chart_deploy_time_debian.png
doc/charts/chart_deploy_time_debian.png
doc/charts/chart_deploy_time_debian.png
doc/charts/chart_deploy_time_debian.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,7 +7,7 @@
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2020-08-16T19:18:09.724445</dc:date>
<dc:date/>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
......
doc/charts/chart_deploy_time_win10.png

130 B | W: | H:

doc/charts/chart_deploy_time_win10.png

130 B | W: | H:

doc/charts/chart_deploy_time_win10.png
doc/charts/chart_deploy_time_win10.png
doc/charts/chart_deploy_time_win10.png
doc/charts/chart_deploy_time_win10.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,7 +7,7 @@
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2020-08-16T19:18:10.751033</dc:date>
<dc:date/>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
......
doc/charts/chart_deploy_time_xubuntu.png

130 B | W: | H:

doc/charts/chart_deploy_time_xubuntu.png

130 B | W: | H:

doc/charts/chart_deploy_time_xubuntu.png
doc/charts/chart_deploy_time_xubuntu.png
doc/charts/chart_deploy_time_xubuntu.png
doc/charts/chart_deploy_time_xubuntu.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,7 +7,7 @@
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2020-08-16T19:18:10.244037</dc:date>
<dc:date/>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
......
doc/charts/chart_image_sizes_debian.png

130 B | W: | H:

doc/charts/chart_image_sizes_debian.png

130 B | W: | H:

doc/charts/chart_image_sizes_debian.png
doc/charts/chart_image_sizes_debian.png
doc/charts/chart_image_sizes_debian.png
doc/charts/chart_image_sizes_debian.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,7 +7,7 @@
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2020-08-16T19:18:08.204014</dc:date>
<dc:date/>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
......
doc/charts/chart_image_sizes_win10.png

130 B | W: | H:

doc/charts/chart_image_sizes_win10.png

130 B | W: | H:

doc/charts/chart_image_sizes_win10.png
doc/charts/chart_image_sizes_win10.png
doc/charts/chart_image_sizes_win10.png
doc/charts/chart_image_sizes_win10.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,7 +7,7 @@
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2020-08-16T19:18:09.215542</dc:date>
<dc:date/>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
......
doc/charts/chart_image_sizes_xubuntu.png

130 B | W: | H:

doc/charts/chart_image_sizes_xubuntu.png

130 B | W: | H:

doc/charts/chart_image_sizes_xubuntu.png
doc/charts/chart_image_sizes_xubuntu.png
doc/charts/chart_image_sizes_xubuntu.png
doc/charts/chart_image_sizes_xubuntu.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,7 +7,7 @@
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2020-08-16T19:18:08.711073</dc:date>
<dc:date/>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
......
doc/charts/chart_protocols.png

130 B | W: | H:

doc/charts/chart_protocols.png

130 B | W: | H:

doc/charts/chart_protocols.png
doc/charts/chart_protocols.png
doc/charts/chart_protocols.png
doc/charts/chart_protocols.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,7 +7,7 @@
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2020-08-16T19:18:07.697144</dc:date>
<dc:date/>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
......
......@@ -10,6 +10,7 @@ import matplotlib.pyplot as plt
# this is a seed that makes the random id in svg always the same for the same input
mpl.rcParams['svg.hashsalt'] = 'bootiful'
def remove_newlines(value):
return str(value).replace('\n', ' ')
......@@ -25,10 +26,10 @@ def csv_to_barchart(file: TextIO) -> plt.Figure:
print(f'|--|--|{"--|" * len(other_labels)}')
data_csv_reader = csv.reader(file, delimiter=';', quoting=csv.QUOTE_NONNUMERIC)
xs=[]
xticks=[]
yticks=[]
ys=[]
xs = []
xticks = []
yticks = []
ys = []
for (x, (xtick, y, *other_values)) in enumerate(data_csv_reader):
ytick = format_value(y)
print(f'|{remove_newlines(xtick)}|{ytick}|{"".join([f"{format_value(value)}|" for value in other_values])}')
......@@ -40,16 +41,17 @@ def csv_to_barchart(file: TextIO) -> plt.Figure:
fig = plt.figure()
plt.bar(xs, ys)
plt.xticks(xs, xticks)
#plt.yticks(ys, yticks)
# plt.yticks(ys, yticks)
plt.xlabel(xlabel)
plt.ylabel(ylabel)
plt.gcf().subplots_adjust(bottom=0.15)
plt.tick_params(axis='x', labelsize=10)
return fig
if __name__ == '__main__':
filenames = argv[1:]
fig = csv_to_barchart(stdin)
for filename in filenames:
fig.savefig(filename)
\ No newline at end of file
fig.savefig(filename, metadata={'Date': ''})
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment