Skip to content

matplotlib-din461 - Changes the appearance of a python matplotlib 2D plot in accordance with DIN461

License

Notifications You must be signed in to change notification settings

CfKu/matplotlib-din461

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

matplotlib-din461

Changes the appearance of a python matplotlib 2D plot in accordance with DIN461.
DIN461 is a German standard:

Minimal example (tested in Python 3.x)

import matplotlib.pyplot as plt
import numpy as np
from matplotlib_din461 import apply_din461

t = np.arange(0.0, 1.0 + 0.01, 0.01)
s = np.cos(4 * np.pi * t) + 2

plt.plot(t, s)
plt.xlabel("Time $t$")
plt.ylabel("Voltage $U$")

ax = plt.gca()
apply_din461(ax, "s", "V")

plt.tight_layout()
plt.show()

Result

matplotlib-din461-example

Parameters of apply_din461

def apply_din461(ax, x_unit_name, y_unit_name, x_left_to_right=True, y_bottom_to_top=True):
  • ax (matplotlib ax): Axis to be motified
  • x_unit_name (unicode): Name of the unit in x direction
  • y_unit_name (unicode): Name of the unit in y direction
  • x_left_to_right (bool): If True, arrow from left to right
  • y_bottom_to_top (bool): If True, arrow bottom to top

License

This project is licensed under the terms of the MIT license - see the LICENSE file for details.

About

matplotlib-din461 - Changes the appearance of a python matplotlib 2D plot in accordance with DIN461

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages