Skip to content

Commit 71f9055

Browse files
Davide ValerianiDavide Valeriani
Davide Valeriani
authored and
Davide Valeriani
committed
Publishing to gh-pages
1 parent c60c520 commit 71f9055

File tree

146 files changed

+4441
-3432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+4441
-3432
lines changed

.DS_Store

14 KB
Binary file not shown.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"public"
1+
"public"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# matplotblog
2-
A new blog to showcase featured matplotlib projects.
3-
4-
To preview the website in local, [install Hugo](https://gohugo.io/getting-started/installing/), open a terminal and type the following:
5-
`cd mpblog_source`
6-
`hugo server -D`
7-
1+
# matplotblog
2+
A new blog to showcase featured matplotlib projects.
3+
4+
To preview the website in local, [install Hugo](https://gohugo.io/getting-started/installing/), open a terminal and type the following:
5+
`cd mpblog_source`
6+
`hugo server -D`
7+
88
Then, you can preview the website opening your favorite browser and pointing to [localhost:1313](http://localhost:1313).

archetypes/default.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
---
2-
title: "{{ replace .Name "-" " " | title }}"
3-
date: {{ .Date }}
4-
draft: true
5-
---
6-
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
date: {{ .Date }}
4+
draft: true
5+
---
6+

config.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
baseURL = "matplotlib.github.io/matplotblog"
2-
languageCode = "en-us"
3-
title = "Matplotblog"
4-
theme = "aether"
5-
canonifyurls = true
6-
paginate = 3
7-
8-
[params]
9-
head_img = "/mpl_logo.png"
10-
description = "The blog of Matplotlib"
11-
bgimg = "bg_tiles.png"
12-
link1 = "http://www.matplotlib.org"
13-
link1_description = "About"
14-
15-
[taxonomies]
16-
category = "categories"
1+
baseURL = "https://matplotlib.github.io/matplotblog"
2+
languageCode = "en-us"
3+
title = "Matplotblog"
4+
theme = "aether"
5+
canonifyurls = true
6+
paginate = 3
7+
8+
[params]
9+
head_img = "/mpl_logo.png"
10+
description = "The blog of Matplotlib"
11+
bgimg = "bg_tiles.png"
12+
link1 = "https://matplotlib.org"
13+
link1_description = "About"
14+
15+
[taxonomies]
16+
category = "categories"

content/posts/a-new-blog/index.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
---
2-
title: "A New Blog"
3-
date: 2019-08-07T22:49:35-04:00
4-
description: "Matplotblog, the new blog of matplotlib, to showcase and share great visualization stories."
5-
categories: ["editorial"]
6-
displayInMenu: false
7-
displayInList: true
8-
draft: false
9-
resources:
10-
- name: featuredImage
11-
src: "logo.jpg"
12-
params:
13-
description: "New Blog image"
14-
---
15-
16-
Matplotlib is an open-source Python visualization library. As such, there are a multitude of contributors and users that assist in improving matplotlib and expanding its reach every day. They have helped it to become what it is and help show the world what is possible with a (relatively) little Python code.
17-
18-
To further help matplotlib users make impressive visualizations and to ultimately tell impactful stories with their data, we have created this blog. This new site will be home to news affecting the matplotlib community, tutorials, and other relevant content.
19-
1+
---
2+
title: "A New Blog"
3+
date: 2019-08-07T22:49:35-04:00
4+
description: "Matplotblog, the new blog of matplotlib, to showcase and share great visualization stories."
5+
categories: ["editorial"]
6+
displayInMenu: false
7+
displayInList: true
8+
draft: false
9+
resources:
10+
- name: featuredImage
11+
src: "logo.jpg"
12+
params:
13+
description: "New Blog image"
14+
---
15+
16+
Matplotlib is an open-source Python visualization library. As such, there are a multitude of contributors and users that assist in improving matplotlib and expanding its reach every day. They have helped it to become what it is and help show the world what is possible with a (relatively) little Python code.
17+
18+
To further help matplotlib users make impressive visualizations and to ultimately tell impactful stories with their data, we have created this blog. This new site will be home to news affecting the matplotlib community, tutorials, and other relevant content.
19+
2020
It is our hope that as we continue to move forward with the project, matplotlib users will enjoy and derive much benefit from the posts contained here.
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
---
2-
title: "Contribute to Matplotlib"
3-
date: 2019-08-14T22:40:35-04:00
4-
description: "This blog will also host a battery of tutorials and articles to introduce new generations to matplotlib; and you can contribute too."
5-
categories: ["tutorials"]
6-
displayInMenu: false
7-
displayInList: true
8-
draft: false
9-
resources:
10-
- name: featuredImage
11-
src: "training.jpg"
12-
params:
13-
description: "tutorials"
14-
---
15-
16-
Matplotlib tries to make easy things easy and hard things possible. With this open-source Python visualization library, you can generate plots, histograms, power spectra, bar charts, error charts, scatter plots, and so on - with just a few lines of code.
17-
18-
From time to time, we'd like to show our readers what can be done with matplotlib through a series of useful tutorials posted here to our blog.
19-
20-
We'd also love to read about what you can do with matplotlib as well.
21-
22-
You can submit blog articles for consideration by submitting a pull request on Github at https://github.com/matplotlib/matplotblog.
23-
1+
---
2+
title: "Contribute to Matplotlib"
3+
date: 2019-08-14T22:40:35-04:00
4+
description: "This blog will also host a battery of tutorials and articles to introduce new generations to matplotlib; and you can contribute too."
5+
categories: ["tutorials"]
6+
displayInMenu: false
7+
displayInList: true
8+
draft: false
9+
resources:
10+
- name: featuredImage
11+
src: "training.jpg"
12+
params:
13+
description: "tutorials"
14+
---
15+
16+
Matplotlib tries to make easy things easy and hard things possible. With this open-source Python visualization library, you can generate plots, histograms, power spectra, bar charts, error charts, scatter plots, and so on - with just a few lines of code.
17+
18+
From time to time, we'd like to show our readers what can be done with matplotlib through a series of useful tutorials posted here to our blog.
19+
20+
We'd also love to read about what you can do with matplotlib as well.
21+
22+
You can submit blog articles for consideration by submitting a pull request on Github at https://github.com/matplotlib/matplotblog.
23+

make_logo.py

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import numpy as np
2+
import matplotlib as mpl
3+
import matplotlib.pyplot as plt
4+
import matplotlib.cm as cm
5+
import matplotlib.font_manager
6+
from matplotlib.patches import Circle, Rectangle, PathPatch
7+
from matplotlib.textpath import TextPath
8+
import matplotlib.transforms as mtrans
9+
10+
MPL_BLUE = '#11557c'
11+
12+
13+
def get_font_properties():
14+
# The original font is Calibri, if that is not installed, we fall back
15+
# to Carlito, which is metrically equivalent.
16+
if 'Calibri' in matplotlib.font_manager.findfont('Calibri:bold'):
17+
return matplotlib.font_manager.FontProperties(family='Calibri',
18+
weight='bold')
19+
if 'Carlito' in matplotlib.font_manager.findfont('Carlito:bold'):
20+
print('Original font not found. Falling back to Carlito. '
21+
'The logo text will not be in the correct font.')
22+
return matplotlib.font_manager.FontProperties(family='Carlito',
23+
weight='bold')
24+
print('Original font not found. '
25+
'The logo text will not be in the correct font.')
26+
return None
27+
28+
29+
def create_icon_axes(fig, ax_position, lw_bars, lw_grid, lw_border, rgrid):
30+
"""
31+
Create a polar axes containing the matplotlib radar plot.
32+
33+
Parameters
34+
----------
35+
fig : matplotlib.figure.Figure
36+
The figure to draw into.
37+
ax_position : (float, float, float, float)
38+
The position of the created Axes in figure coordinates as
39+
(x, y, width, height).
40+
lw_bars : float
41+
The linewidth of the bars.
42+
lw_grid : float
43+
The linewidth of the grid.
44+
lw_border : float
45+
The linewidth of the Axes border.
46+
rgrid : array-like
47+
Positions of the radial grid.
48+
49+
Returns
50+
-------
51+
ax : matplotlib.axes.Axes
52+
The created Axes.
53+
"""
54+
with plt.rc_context({'axes.edgecolor': MPL_BLUE,
55+
'axes.linewidth': lw_border}):
56+
ax = fig.add_axes(ax_position, projection='polar')
57+
ax.set_axisbelow(True)
58+
59+
N = 7
60+
arc = 2. * np.pi
61+
theta = np.arange(0.0, arc, arc / N)
62+
radii = np.array([2, 6, 8, 7, 4, 5, 8])
63+
width = np.pi / 4 * np.array([0.4, 0.4, 0.6, 0.8, 0.2, 0.5, 0.3])
64+
bars = ax.bar(theta, radii, width=width, bottom=0.0, align='edge',
65+
edgecolor='0.3', lw=lw_bars)
66+
for r, bar in zip(radii, bars):
67+
color = *cm.jet(r / 10.)[:3], 0.6 # color from jet with alpha=0.6
68+
bar.set_facecolor(color)
69+
70+
ax.tick_params(labelbottom=False, labeltop=False,
71+
labelleft=False, labelright=False)
72+
73+
ax.grid(lw=lw_grid, color='0.9')
74+
ax.set_rmax(9)
75+
ax.set_yticks(rgrid)
76+
77+
# the actual visible background - extends a bit beyond the axis
78+
ax.add_patch(Rectangle((0, 0), arc, 9.58,
79+
facecolor='white', zorder=0,
80+
clip_on=False, in_layout=False))
81+
return ax
82+
83+
84+
def create_text_axes(fig, height_px):
85+
"""Create an axes in *fig* that contains 'matplotlib' as Text."""
86+
ax = fig.add_axes((0, 0, 1, 1))
87+
ax.set_aspect("equal")
88+
ax.set_axis_off()
89+
90+
path = TextPath((0, 0), "matplotblog", size=height_px * 0.8,
91+
prop=get_font_properties())
92+
93+
angle = 4.25 # degrees
94+
trans = mtrans.Affine2D().skew_deg(angle, 0)
95+
96+
patch = PathPatch(path, transform=trans + ax.transData, color=MPL_BLUE,
97+
lw=0)
98+
ax.add_patch(patch)
99+
ax.autoscale()
100+
101+
102+
def make_logo(height_px, lw_bars, lw_grid, lw_border, rgrid, with_text=False):
103+
"""
104+
Create a full figure with the Matplotlib logo.
105+
106+
Parameters
107+
----------
108+
height_px : int
109+
Height of the figure in pixel.
110+
lw_bars : float
111+
The linewidth of the bar border.
112+
lw_grid : float
113+
The linewidth of the grid.
114+
lw_border : float
115+
The linewidth of icon border.
116+
rgrid : sequence of float
117+
The radial grid positions.
118+
with_text : bool
119+
Whether to draw only the icon or to include 'matplotlib' as text.
120+
"""
121+
dpi = 100
122+
height = height_px / dpi
123+
figsize = (5 * height, height) if with_text else (height, height)
124+
fig = plt.figure(figsize=figsize, dpi=dpi)
125+
fig.patch.set_alpha(0)
126+
127+
if with_text:
128+
create_text_axes(fig, height_px)
129+
ax_pos = (0.45, 0.12, .17, 0.75) if with_text else (0.03, 0.03, .94, .94)
130+
ax = create_icon_axes(fig, ax_pos, lw_bars, lw_grid, lw_border, rgrid)
131+
132+
return fig, ax
133+
134+
make_logo(height_px=110, lw_bars=0.7, lw_grid=0.5, lw_border=1,
135+
rgrid=[1, 3, 5, 7], with_text=True)
136+
plt.savefig("mpl_logo.png")

public/bg_tiles.png

177 KB
Loading
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us" dir="ltr">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="x-ua-compatible" content="ie=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<title>editorial &middot; Matplotblog</title>
8+
<meta name="description" content="" />
9+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
10+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
11+
12+
13+
14+
15+
<link href="https://matplotlib.github.io/matplotblog/css/concated.min.css" rel="stylesheet">
16+
<link rel="alternate" type="application/rss+xml" href="https://matplotlib.github.io/matplotblog/categories/editorial/index.xml" title="Matplotblog" />
17+
18+
<style>
19+
body {
20+
background: #ecedef url("https://matplotlib.github.io/matplotblog/bg_tiles.png") repeat;
21+
}
22+
</style>
23+
</head>
24+
25+
<body class="list-body">
26+
<nav class="nav-bar side-padding">
27+
<h1 class="nav-header"><a href="https://matplotlib.github.io/matplotblog" class="nav-text">
28+
29+
<img src="https://matplotlib.github.io/matplotblog/mpl_logo.png">
30+
31+
32+
</a></h1>
33+
<div class="hamburger-menu">
34+
<button onclick="hamburgerMenuPressed.call(this)" aria-haspopup="true" aria-expanded="false" aria-controls="menu" aria-label="Menu">
35+
<span></span>
36+
<span></span>
37+
</button>
38+
<ul id="menu" class="hamburger-menu-overlay">
39+
<li><a href="https://matplotlib.github.io/matplotblog" class="hamburger-menu-overlay-link">Home</a></li>
40+
<li><a href="https://matplotlib.github.io/matplotblog/categories/editorial" class="hamburger-menu-overlay-link">Editorial</a></li><li><a href="https://matplotlib.github.io/matplotblog/categories/tutorials" class="hamburger-menu-overlay-link">Tutorials</a></li>
41+
42+
43+
<li><a href="https://matplotlib.org" class="hamburger-menu-overlay-link" target="blank">About</a></li>
44+
45+
46+
47+
</ul>
48+
</div>
49+
</nav>
50+
51+
<main class="card-container side-gutter">
52+
<header class="list-header">
53+
54+
<h1 class="list-header-title">editorial</h1>
55+
</header>
56+
57+
<a ontouchstart="cardPressed.call(this)" ontouchend="cardReleased.call(this)" ontouchmove="cardReleased.call(this)"
58+
href="https://matplotlib.github.io/matplotblog/posts/a-new-blog/" class="card blog-card" rel="bookmark" >
59+
60+
<div class="card-img-container">
61+
<picture>
62+
63+
64+
<source srcset="https://matplotlib.github.io/matplotblog/posts/a-new-blog/logo_hu4e50637dd633a6a4299ff7ca839f6ef9_26563_400x300_fit_q75_lanczos.jpg">
65+
<img src="https://matplotlib.github.io/matplotblog/posts/a-new-blog/logo_hu4e50637dd633a6a4299ff7ca839f6ef9_26563_400x300_fit_q75_lanczos.jpg" class="card-img" alt="New Blog image">
66+
</picture>
67+
</div>
68+
<article class="card-body">
69+
<h2 class="card-title">A New Blog</h2>
70+
<p class="card-text">Matplotblog, the new blog of matplotlib, to showcase and share great visualization stories.</p>
71+
<div class="card-subtext muted-text">
72+
<p>Posted <time datetime="2019-08-07">Aug 7, 2019</time></p>
73+
<p>#editorial </p>
74+
</div>
75+
</article>
76+
</a>
77+
</main>
78+
79+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
80+
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
81+
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"
82+
onload="renderMathInElement(document.body);"></script>
83+
84+
<script src="https://matplotlib.github.io/matplotblog/js/core.min.js"></script>
85+
<script>
86+
hljs.initHighlightingOnLoad();
87+
</script>
88+
89+
</body>
90+
</html>

0 commit comments

Comments
 (0)