JuliaPlots / PlotDocs.jl

Documentation for Plots.jl
http://docs.juliaplots.org/stable
MIT License
94 stars 96 forks source link

Add series type introduction pages #322

Closed Ininterrompue closed 1 year ago

Ininterrompue commented 1 year ago

Fix https://github.com/JuliaPlots/PlotDocs.jl/issues/54 Fix https://github.com/JuliaPlots/PlotDocs.jl/issues/296

Ininterrompue commented 1 year ago

@t-bltg PR is ready for review, however build is failing when trying to use PyPlot...

t-bltg commented 1 year ago

Same error as https://github.com/JuliaPlots/Plots.jl/blob/fceaf217e59dd4c200491d09608049ba433cd2f8/src/examples.jl#L1239.

No fix currently (conda library incompatibility), so we cannot merge this PR as is :/

Ininterrompue commented 1 year ago

Got it, I will replace those code examples with backticked Julia code instead

t-bltg commented 1 year ago

@Ininterrompue I think the libstdc++.so.X: version GLIBCXX_X.X.X bug is now fixed, can you revert the 2 latest commits, and rebase this PR against master, this should work now.

Ininterrompue commented 1 year ago

Ok I've rewritten the examples to be compatible with GR. However I'm still preferring PyPlot for the renders because I'm still getting some bugs when using GR. For example,

g(x, y) = log(x*y)

x = 10 .^ range(0, 6, length=100)
y = 10 .^ range(0, 6, length=100)
z = @. g(x', y)
contourf(x, y, z, color=:plasma,
    xscale=:log10, yscale=:log10,
    title=L"\log(xy)",
    xlabel=L"x",
    ylabel=L"y")

renders incorrectly: test

whereas its PyPlot version renders correctly:

Figure_1

And I think this is a known issue. Also, the contour labels look cleaner in PyPlot and use round numbers. And in the last plot, the figure window does not expand in PyPlot like it does in GR, even though aspect_ratio=:equal is used, so PyPlot is imo more visually appealing.

t-bltg commented 1 year ago

Thanks for adjusting the examples.

That's an interesting bug indeed. The only issue I could find was https://discourse.julialang.org/t/issues-with-plots-contourf-and-logarithmic-axes/74185. But it is strange that this has not been discussed elsewhere in Plots.jl or GR.jl.

I think it's worth opening an issue to fix this. EDIT: opened an issue here: https://github.com/JuliaPlots/Plots.jl/issues/4540.

t-bltg commented 1 year ago

Thanks for the quality work here @Ininterrompue !

Ininterrompue commented 1 year ago

@t-bltg I don't see the new changes on dev; deployment was canceled here, is there an error with my code?

t-bltg commented 1 year ago

Probably a spurious failure. I've restarted it ...

t-bltg commented 1 year ago

Hum, still failing but github seems green: https://www.githubstatus.com/.

t-bltg commented 1 year ago

@Ininterrompue, https://docs.juliaplots.org/dev/series_types/contour/ :tada: .