Skip to main content

Extension package for maliang to matplotlib

Project description

maliang-mpl

https://xiaokang2022.github.io/tkintertools/

Extension package of maliang for matplotlib

Version Downloads Total Downloads Size
Watchers Forks Stars Issues Pull Requests Discussions

Insights

Star History Chart

📦 Installation

pip install tkintertools-mpl

👀 Preview

preview-1

import math

import matplotlib.figure
import numpy

import tkintertools
from tkintertools import mpl, theme

mpl.set_mpl_default_theme(theme.get_color_mode())

x = numpy.linspace(-math.tau, math.tau, 100)
y = numpy.sin(x)

figure = matplotlib.figure.Figure()
axes = figure.add_subplot()
axes.plot(x, y)

axes.set(xlabel='x', ylabel='y', title='Plotting based on the theme in tkt')
axes.legend(["$y=sin(x)$"])
axes.grid()

root = tkintertools.Tk((960, 720), title="tkintertools-mpl")
root.center()
canvas = tkintertools.Canvas(auto_zoom=True)
canvas.place(width=960, height=720)
figure_canvas = mpl.FigureCanvas(canvas, figure)
toolbar = mpl.FigureToolbar(canvas, figure_canvas)
figure_canvas.pack(side="top", fill="both", expand=True)

root.mainloop()

preview-2

import matplotlib.figure
import numpy

import tkintertools
from tkintertools import mpl, theme

mpl.set_mpl_default_theme(theme.get_color_mode())

figure = matplotlib.figure.Figure()
axes = figure.add_subplot(projection='3d')

colors = ['r', 'g', 'b', 'y']
yticks = [3, 2, 1, 0]

for c, k in zip(colors, yticks):
    xs = numpy.arange(20)
    ys = numpy.random.rand(20)
    cs = [c] * len(xs)
    cs[0] = 'c'
    axes.bar(xs, ys, zs=k, zdir='y', color=cs, alpha=0.7)

axes.set_xlabel('X')
axes.set_ylabel('Y')
axes.set_zlabel('Z')
axes.set_title("3D plotting with interoperability")

axes.set_yticks(yticks)

root = tkintertools.Tk((960, 720), title="tkintertools-mpl")
root.center()
canvas = tkintertools.Canvas(auto_update=True)
canvas.place(width=960, height=720)
figure_canvas = mpl.FigureCanvas(canvas, figure)
toolbar = mpl.FigureToolbar(canvas, figure_canvas)
figure_canvas.pack(side="top", fill="both", expand=True)

root.mainloop()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maliang_mpl-1.2.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maliang_mpl-1.2.3-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file maliang_mpl-1.2.3.tar.gz.

File metadata

  • Download URL: maliang_mpl-1.2.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for maliang_mpl-1.2.3.tar.gz
Algorithm Hash digest
SHA256 cbe9ae457fcb10f7a5ef830fa4561cb3de1faeba0092f15f7b90db5cb7995f10
MD5 f61ec1f8b7036cc2dce368de35422191
BLAKE2b-256 095335f78d9aeea8b1b21125ac6e22898afdcd13a0bfb98213cb70743d0e4e9a

See more details on using hashes here.

File details

Details for the file maliang_mpl-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: maliang_mpl-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for maliang_mpl-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 434941e0fe8c043f131c1fbef47c0c0b712480582396280288179d9be9ba6f7d
MD5 3e700150974f911f35d586efb082e260
BLAKE2b-256 4d97840b54871cbaa16de793ba0c63e68a622c679e3bb996c3ae438b5b976fb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page