Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
fig.savefig(doc_examples_image_folder + 'adjust_figure_change_background.svg', bbox_inches='tight', facecolor='#DDDDDD')
plt.close(fig)
fig = plt.figure(
FigureClass=Waffle,
rows=5,
values=[30, 16, 4],
plot_anchor='S',
facecolor='#DDDDDD'
)
fig.savefig(doc_examples_image_folder + 'adjust_figure_location.svg', facecolor='#DDDDDD')
plt.close(fig)
fig = plt.figure(
FigureClass=Waffle,
rows=5,
values=[30, 16, 4]
)
fig.text(
x=0.5,
y=0.5,
s="Sample",
ha="center",
va="center",
rotation=30,
fontsize=40,
color='gray',
alpha=0.3,
bbox={
'boxstyle': 'square',
'lw': 3,
#!/usr/bin/python
# -*-coding: utf-8 -*-
# Run `python3 -m README_images.generate_plots` on root folder to generate plots for README
import matplotlib.pyplot as plt
from pywaffle.waffle import Waffle
# For README
readme_image_folder = 'examples/readme/'
# Basic
fig = plt.figure(FigureClass=Waffle, rows=5, columns=10, values=[48, 46, 6], figsize=(5, 3))
fig.savefig(readme_image_folder + 'basic.svg', bbox_inches='tight')
plt.close(fig)
# Use values in dictionary; use absolute value as block number, without defining columns
data = {'Democratic': 48, 'Republican': 46, 'Libertarian': 3}
fig = plt.figure(FigureClass=Waffle, rows=5, values=data, legend={'loc': 'upper left', 'bbox_to_anchor': (1.1, 1)})
fig.savefig(readme_image_folder + 'absolute_block_numbers.svg', bbox_inches='tight')
plt.close(fig)
# Add title, legend, background color, block color, direction and style
# Data source https://en.wikipedia.org/wiki/United_States_presidential_election,_2016
data = {'Democratic': 48, 'Republican': 46, 'Libertarian': 3}
fig = plt.figure(
FigureClass=Waffle,
rows=5,
values=data,