Group Abstract Group Abstract

Message Boards Message Boards

1
|
5.8K Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

ChartLegends can be orphans

Posted 12 years ago

Simple example from the documentation.

mychart = 
 BarChart[{1, 2, 3}, ChartStyle -> "Pastel", 
  ChartLegends -> {"John", "Mary", "Bob"}]

The legends appear in the output cell but if one right-clicks on the image only the chart proper is selected, the legends remain outside the image. See "naked chart.pdf"

If the chart is exported the legends do get included.

Export[NotebookDirectory[] <> "barchart.pdf", mychart]

See attached.

Attachments:
POSTED BY: Douglas Kubler
5 Replies
Posted 12 years ago

I tried using Placed[] for the legends. When off the chart body they were orphaned. At the Center they became part of the image. Right-click and save everything works. Center was an unaesthetic position so I tried a few numbers (in a positioning system yet to be decoded). Zero (0) did a fair job.

mychart = 
 BarChart[{1, 2, 3}, ChartStyle -> "Pastel", 
  ChartLegends -> Placed[{"John", "Mary", "Bob"}, {0, Center}]]

The Head of mychart is still Legended.

Attachments:
POSTED BY: Douglas Kubler
POSTED BY: David Reiss
Posted 12 years ago
POSTED BY: David Keith
Posted 12 years ago
POSTED BY: Douglas Kubler
Posted 12 years ago

Plot legends has been a long and winding road. (With plenty of begging and pleading from me.) It is much improved, but perhaps not yet in a state of grace. It does seem that the output should be a Graphic, but I wonder if there are then issues making some of the drawing tools work properly, especially the nice Get Coordinates tool, which knows the actual coordinate values on the plot, not just the scaled values.

POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard