Skip to content

Commit 3766685

Browse files
committed
Fix the casing of the svg color MediumAquamarine in StatisticalPlots.pl.
Although JSXGraph is lenient with this, LaTeX and TikZ are not. So if you use the `greens` color palette you end up getting the stroke color for this color in TikZ output. but an aqua marine color for JSXGraph output. Here is a MWE for testing this: ``` DOCUMENT(); loadMacros('PGstandard.pl', 'PGML.pl', 'StatisticalPlots.pl', 'PGcourse.pl'); $barPlot = StatPlot(xmin => 0, xmax => 7, ymin => 0, ymax => 10); $barPlot->add_barplot( [ 1 .. 6 ], [ 3, 6, 7, 8, 4, 1 ], fill_colors => { palette_name => 'greens' } ); BEGIN_PGML [< [<[@ $barPlot->image_type('Tikz'); @]* [!TikZ bar plot!]{$barPlot}{400}>] [<[@ $barPlot->image_type('JSXGraph'); @]* [!JSXGraph bar plot!]{$barPlot}{400}>] >]{ [ class => 'd-flex gap-3 flex-wrap' ] } END_PGML ENDDOCUMENT(); ``` I thought I had fixed all of these in my changes to #1374, but I seem to have missed this one.
1 parent e9238cc commit 3766685

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

macros/graph/StatisticalPlots.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ =head3 OPTIONS
125125
(C<palette_name>) and number of colors to generate (C<num_colors>) (see L<COLOR
126126
PALETTES> for more information). If this is a reference to an array and the
127127
length of the array is smaller than the number of data values in the array
128-
referenced to by C<$data>, then the colors will be cycled.
128+
referenced to by C<$data>, then the colors will be cycled.
129129
130-
If C<fill_color> is included in the list of options, this will apply the same
131-
color to each bar. If neither C<fill_color> nor C<fill_colors> is included,
130+
If C<fill_color> is included in the list of options, this will apply the same
131+
color to each bar. If neither C<fill_color> nor C<fill_colors> is included,
132132
then the 'rainbow' palette will be used as default.
133133
134134
For example,
@@ -845,7 +845,7 @@ sub color_palette {
845845
if ($palette_name eq 'rainbow') {
846846
return [ 'Violet', 'blue', 'green', 'yellow', 'orange', 'red' ];
847847
} elsif ($palette_name eq 'greens') {
848-
return [ 'Green', 'Olive', 'DarkGreen', 'LawnGreen', 'MediumAquaMarine', 'LimeGreen' ];
848+
return [ 'Green', 'Olive', 'DarkGreen', 'LawnGreen', 'MediumAquamarine', 'LimeGreen' ];
849849
} elsif ($palette_name eq 'blues') {
850850
return [ 'Blue', 'MidnightBlue', 'MediumBlue', 'LightSkyBlue', 'DodgerBlue', 'DarkBlue', 'CornflowerBlue' ];
851851
} elsif ($palette_name eq 'reds') {

0 commit comments

Comments
 (0)