Skip to content

Commit

Permalink
scatter plot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Mar 6, 2024
1 parent 7db882f commit 8e91c3e
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/MadsPlot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ function scatterplotsamples(madsdata::AbstractDict, samples::AbstractMatrix, fil
if separate_files
hsize = 6Gadfly.inch
vsize = 6Gadfly.inch
major_label_font_size /= np / 4
minor_label_font_size /= np / 4
major_label_font_size *= np / 8
minor_label_font_size *= np / 8
filename_root, filename_ext = splitext(filename)
else
hsize = (6 * np)Gadfly.inch
Expand All @@ -454,29 +454,25 @@ function scatterplotsamples(madsdata::AbstractDict, samples::AbstractMatrix, fil
nz = convert(Int64, ceil(log10(np))) + 1
@ProgressMeter.showprogress 1 "Ploting histogram and scatter plots ..." for i in 1:np
for j in 1:np
if i == j
if i == j && :histogram in plottypes
p = Gadfly.plot(x=samples[:, i], Gadfly.Geom.histogram,
Gadfly.Guide.XLabel(plotlabels[i]),
Gadfly.Theme(major_label_font_size=major_label_font_size, minor_label_font_size=minor_label_font_size)
)
if separate_files
if :histogram in plottypes
fn = filename_root * "_histogram_" * "$(lpad(i, nz, '0'))_" * plotlabels[i] * filename_ext
plotfileformat(p, fn, hsize, vsize; format=format, dpi=dpi)
end
fn = filename_root * "_histogram_" * "$(lpad(i, nz, '0'))_" * plotlabels[i] * filename_ext
plotfileformat(p, fn, hsize, vsize; format=format, dpi=dpi)
else
cs[j, i] = Gadfly.render(p)
end
else i != j
elseif i != j && :scatter in plottypes
p = Gadfly.plot(x=samples[:, i], y=samples[:, j],
Gadfly.Guide.XLabel(plotlabels[i]), Gadfly.Guide.YLabel(plotlabels[j]),
Gadfly.Theme(major_label_font_size=major_label_font_size, minor_label_font_size=minor_label_font_size, point_size=pointsize, highlight_width=highlight_width)
)
if separate_files
if :scatter in plottypes
fn = filename_root * "_scatter_" * "$(lpad(i, nz, '0'))_" * "$(lpad(j, nz, '0'))_" * plotlabels[i] * "_" * plotlabels[j] * filename_ext
plotfileformat(p, fn, hsize, vsize; format=format, dpi=dpi)
end
fn = filename_root * "_scatter_" * "$(lpad(i, nz, '0'))_" * "$(lpad(j, nz, '0'))_" * plotlabels[i] * "_" * plotlabels[j] * filename_ext
plotfileformat(p, fn, hsize, vsize; format=format, dpi=dpi)
else
cs[j, i] = Gadfly.render(p)
end
Expand Down

2 comments on commit 8e91c3e

@montyvesselinov
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/102409

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.5.14 -m "<description of version>" 8e91c3e19cc6990e611573dd71ba1b1ea6598a48
git push origin v1.5.14

Please sign in to comment.