Skip to content

DOC: Enhance Documentation with MATLAB Comparison and Visualization Guide #27749

@joaomarcalst

Description

@joaomarcalst

Issue with current documentation:

The current NumPy documentation is robust but could benefit from additional guidance for users transitioning from MATLAB, particularly those who rely on MATLAB’s built-in plotting functions. While NumPy is often paired with Matplotlib for visualizations, this connection is not explicitly outlined in the documentation. Providing clarity on using NumPy arrays directly with Matplotlib for plotting could greatly assist users seeking to replicate MATLAB-like functionalities in Python.

Reference:
For example, the NumPy User Guide could include a section specifically for “Transitioning from MATLAB to NumPy + Matplotlib,” covering introductory visualization needs. This section might provide mappings between common MATLAB commands and equivalent NumPy and Matplotlib approaches.

Example:
In MATLAB, a basic 2D plot for a sine wave might use:
x = 0:0.01:2*pi;
y = sin(x);
plot(x, y);

The equivalent in NumPy + Matplotlib could be shown as:
import numpy as np
import matplotlib.pyplot as plt

x = np.arange(0, 2 * np.pi, 0.01)
y = np.sin(x)
plt.plot(x, y)
plt.show()

Idea or request for content:

Request for New Content:
To better support users accustomed to MATLAB, a dedicated section on “Advanced Visualization Techniques with NumPy and Matplotlib” could be added to the NumPy documentation. This section would guide users through complex plotting needs by demonstrating how NumPy arrays integrate with Matplotlib to produce a variety of plots. Suggested content includes:

  • Mapping Common MATLAB Plot Commands to Python: Provide a table comparing MATLAB plotting functions with their NumPy + Matplotlib counterparts. This would give MATLAB users an easy reference for adapting their workflows.
image
  • Examples of 2D and 3D Plotting:

2D Contour Plot:
image

3D Surface Plot:
image

  • Motivation for Adding This Content:
    This documentation addition would make NumPy more accessible for MATLAB users, who may be considering switching due to MATLAB’s high cost. By showing how NumPy and Matplotlib can provide a free and flexible alternative to MATLAB’s visualization capabilities, users can see the viability of Python as a cost-effective solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy