Skip to content

fix the plt show example in README for Julia 0.7 - #548

Closed
xiuliren wants to merge 2 commits into
JuliaPy:masterfrom
xiuliren:patch-1
Closed

xiuliren wants to merge 2 commits into
JuliaPy:masterfrom
xiuliren:patch-1

Conversation

@xiuliren

Copy link
Copy Markdown

the old one do not work in Julia 0.7

the old one do not work in Julia 0.7
Comment thread README.md Outdated
x = linspace(0,2*pi,1000); y = sin(3*x + 4*cos(2*x));
@pyimport math
x = range(0, step=2*pi, length=1000);
y = math.sin.(3.*x + 4*math.cos.(2.*x));

@stevengj stevengj Aug 31, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for the Python math functions. Just use

y = @. sin(3x + 4cos(2x))

Comment thread README.md Outdated
@pyimport matplotlib.pyplot as plt
x = linspace(0,2*pi,1000); y = sin(3*x + 4*cos(2*x));
@pyimport math
x = range(0, step=2*pi, length=1000);

@stevengj stevengj Aug 31, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be stop=2pi, not step.

Comment thread README.md Outdated
options, and this functionality is accessed from Julia by:

using PyCall
using Statistics

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need Statistics?

@xiuliren

Copy link
Copy Markdown
Author

@stevengj thanks for the comments, I have corrected them.

@yuyichao

Copy link
Copy Markdown
Collaborator

Seems to be mostly replaced by a later PR #663. The only change that's not in is the addition of using PyCall but it seems that many other examples there assumes it to be run as well.

@yuyichao yuyichao closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants