Skip to main content

Arabic SciPlot — الرسم العلمي بالعربية

حزمة صغيرة لتنسيق عناوين الرسوم البيانية ومحاورها وتدريجاتها بالعربية باستخدام Matplotlib، مع أدوات رقمية يمكن استعمالها في Plotly.

التثبيت

يتطلب الإصدار 0.1.0 بايثون 3.11 أو أحدث وMatplotlib 3.11 أو أحدث.

بعد نشر الحزمة في PyPI:

pip install arabic-sciplot

للتجربة من المستودع قبل النشر:

pip install -e .

ولتشغيل أمثلة Plotly وB-spline الاختيارية: pip install -e ".[examples]".

الاستعمال

import numpy as np
import matplotlib.pyplot as plt
from arabic_sciplot import arab, arabic_2d_axis_formatter

x = np.linspace(-5, 5, 200)
fig, ax = plt.subplots()
ax.plot(x, x**2)
ax.set_title(arab("تمثيل دالة تربيعية"))
arabic_2d_axis_formatter(ax)
plt.show()

التوابع المتاحة: arab، custom_formatter، custom_log_formatter، pi_formatter، generate_tickvals_and_text، arabic_2d_axis_formatter، arabic_3d_axis_formatter، وarabic_3d_plot_formatter.

يمكن تعطيل قلب المحور أو تعديل نمط التدريجات من غير تغيير الإعدادات الافتراضية القديمة:

arabic_2d_axis_formatter(ax, invert_x=False, y_on_right=False,
                         tick_direction="out", tick_length=4, tick_labelsize=12)

مثال ثلاثي الأبعاد (Matplotlib)

import numpy as np
import matplotlib.pyplot as plt
from arabic_sciplot import arabic_3d_axis_formatter

t = np.linspace(0, 4 * np.pi, 300)
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
ax.plot(np.cos(t), np.sin(t), t)
arabic_3d_axis_formatter(ax)
ax.set_title("منحنى حلزوني ثلاثي الأبعاد")
plt.show()

مثال تدريجات رياضية (Plotly — تبعية اختيارية)

للتشغيل: pip install "arabic-sciplot[plotly]" بعد نشر الحزمة، أو pip install -e ".[plotly]" من المستودع.

import numpy as np
import plotly.graph_objects as go
from arabic_sciplot import generate_tickvals_and_text

x = np.linspace(-np.pi, np.pi, 100)
tickvals, ticktext = generate_tickvals_and_text(
    x, num_ticks=5, use_pi_format=True
)
fig = go.Figure()
fig.add_scatter(x=x, y=np.sin(x))
fig.update_xaxes(title="س", tickvals=tickvals, ticktext=ticktext)
fig.show()

اتجاه الكتابة والخطوط

أضاف Matplotlib 3.11 دعم تشكيل الحروف العربية وترتيب الكتابة من اليمين إلى اليسار. لذلك يعيد arab(text) النص نفسه دون تغييره، ولم نعد نستخدم arabic-reshaper أو python-bidi. لا تُمرّر نصًا مُعاد تشكيله مسبقًا إلى Matplotlib الجديد؛ فقد ينعكس ترتيبه مرتين.

يجب توفر خط يدعم المحارف المطلوبة، مثل DejaVu Sans للحروف الشائعة، أو Amiri أو Noto Naskh Arabic لبعض النصوص والتشكيل. لا تُضمّن الحزمة خطوطًا ولا تفرض خطًا على المستخدم. يمكن تعيين خط مثبت لديك عبر plt.rcParams["font.family"] = "Amiri". يعتمد العرض النهائي على الخط ومحرك الرسم.

تُبقي الدوال الإعدادات القديمة للمحاور: قلب المحور السيني، ونقل تدريجات الصادات إلى اليمين في الرسم الثنائي، وقلب المحورين الأفقيين في الرسم الثلاثي.

أمثلة

الترخيص

MIT — انظر LICENSE.

للمطورين ووكلاء الذكاء الاصطناعي

Metadata

Release files for arabic-sciplot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arabic-sciplot 0.1.0
File Size Uploaded Provenance Actions
arabic_sciplot-0.1.0.tar.gz 6.8 kB With provenance Details for arabic_sciplot-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for arabic-sciplot 0.1.0
File Interpreter ABI Platform Actions
arabic_sciplot-0.1.0-py3-none-any.whl Python 3 none any Details for arabic_sciplot-0.1.0-py3-none-any.whl

Total release size: 13.7 kB

Release files / arabic_sciplot-0.1.0.tar.gz

Download URL arabic_sciplot-0.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1886b5adae7175c39f669e33cbe12bce963741fc2cf95c0e1d5e289dcc9eff4c
BLAKE2b-256 checksum
How to use checksums
d1216a717959eb225e3926221736848993c009beb2f372de614280f9ceaa4712
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / arabic_sciplot-0.1.0-py3-none-any.whl

Download URL arabic_sciplot-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35e58a92333df2b1eb2378c4fd5b8725b25c242712e63d6a3367905fbe227035
BLAKE2b-256 checksum
How to use checksums
194998c9e44bc013f47da18e3f67ae6d698385c6452e0389e163ea65e24a39dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for arabic-sciplot 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for arabic_sciplot-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page