Skip to content

Clean up and fix issues in the StatisticalPlots.pl macro.#37

Open
drgrice1 wants to merge 1 commit into
pstaabp:statistical-plotsfrom
drgrice1:statistical-plots-work
Open

Clean up and fix issues in the StatisticalPlots.pl macro.#37
drgrice1 wants to merge 1 commit into
pstaabp:statistical-plotsfrom
drgrice1:statistical-plots-work

Conversation

@drgrice1
Copy link
Copy Markdown

@drgrice1 drgrice1 commented Jun 3, 2026

The POD is rather heftily rewritten, and there were a lot of issues in the code that were fixed. I don't even remember all of them, since I did this several months ago.

One issue was with the set_plot_option_aliases method. It defined the aliases with a hash with duplicate keys. That means only the last one of the duplicates actually worked. So the definition needed to be inverted to function right.

Another option was with incorrectly names svg colors.

Also, switch to using the new plots padding option instead of using a multiplier. The padding options scales better.

Don't blindly add the fill => 'self' option to everything. Just add it to things that can be possible filled.

Also, there was quite a bit of general code clean up.

The POD is rather heftily rewritten, and there were a lot of issues in
the code that were fixed.  I don't even remember all of them, since I
did this several months ago.

One issue was with the `set_plot_option_aliases` method.  It defined the
aliases with a hash with duplicate keys.  That means only the last one
of the duplicates actually worked. So the definition needed to be
inverted to function right.

Another option was with incorrectly names svg colors.

Also, switch to using the new plots `padding` option instead of using a
multiplier. The `padding` options scales better.

Don't blindly add the `fill => 'self'` option to everything.  Just add
it to things that can be possible filled.

Also, there was quite a bit of general code clean up.
@pstaabp
Copy link
Copy Markdown
Owner

pstaabp commented Jun 3, 2026

Looks good.

About the histogram, were you mentioning trying to programmatically find the max/min in way for it to line up better than just the min/max of the dataset?

@drgrice1
Copy link
Copy Markdown
Author

drgrice1 commented Jun 3, 2026

Yes. That and the maximum value of the range. In general for a single vertical histogram the vertical axis should be on the leftmost boundary of the image and be a little to the left of the leftmost box, and the rightmost edge of the image should be a little to the right of the rightmost box (as far to the right as the left is).

Also, the maximum of the vertical range should be a little more than the top of the highest bar.

Of course similar constraints for a horizontal histogram.

Things are complicated if multiple histograms are in the same image though.

@drgrice1
Copy link
Copy Markdown
Author

drgrice1 commented Jun 3, 2026

I was also thinking that there should be an option that disables the setting of these ranges optimally for a single histogram. Of course, the point of that would be for multiple histograms.

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.

2 participants