-
-
Notifications
You must be signed in to change notification settings - Fork 79
StatisticalPlots macro #1374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
StatisticalPlots macro #1374
Changes from all commits
84a9d72
97465b5
16538fa
5fd4d24
e3a3722
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2923,7 +2923,7 @@ sub image { | |
| ); | ||
| next; | ||
| } | ||
| if (ref $image_item eq 'Plots::Plot') { | ||
| if (ref $image_item eq 'Plots::Plot' || ref $image_item eq 'Plots::StatPlot') { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be worthwhile to make this more general, for future extension macros. Maybe call your package
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also think there are some other places that might need to be updated, I recall having to modify a few places to check for the ref being equal to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally this would be an When I was creating the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, line 2946 below needs to check the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DO NOT add this ref check to either The As to the |
||
| # Update image attributes as needed. | ||
| $image_item->{width} = $width if $out_options{width}; | ||
| $image_item->{height} = $height if $out_options{height}; | ||
|
|
@@ -2942,10 +2942,7 @@ sub image { | |
| $width_ratio = 0.001 * $image_item->{tex_size}; | ||
| } | ||
| $image_item = insertGraph($image_item) | ||
| if (ref $image_item eq 'WWPlot' | ||
| || ref $image_item eq 'Plots::Plot' | ||
| || ref $image_item eq 'PGlateximage' | ||
| || ref $image_item eq 'PGtikz'); | ||
| if (grep { ref $image_item eq $_ } ('WWPlot', 'Plots::Plot', 'Plots::StatPlot', 'PGlateximage', 'PGtikz')); | ||
| my $imageURL = alias($image_item) // ''; | ||
| $imageURL = ($envir{use_site_prefix}) ? $envir{use_site_prefix} . $imageURL : $imageURL; | ||
| my $id = $main::PG->getUniqueName('img'); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather inconsistent with the rest of the
Plot.pmcode.Most of the plots methods allow adding one or multiple of each object at a time. The
add_rectanglemethod should do this as well.No where in the plots code is the
Value::Errormethod used to give messages about incorrect usage, and for good reason. CallingValue::Errordies and prevents the entire problem from rendering. That should really only be done in answer checkers where those exceptions are caught, and not for something like this where you really just want to notify the problem author of incorrect usage. Awarnis certainly sufficient for that, and then the problem can still render. There is also no need for a separate message for the two points. Just give one.In short change this to