Opened 10 years ago

Last modified 7 years ago

#11978 new defect

Polar plot with short axis has overlapping labels

Reported by: kcrisman Owned by: jason, was
Priority: minor Milestone: sage-6.4
Component: graphics Keywords:
Cc: jason Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by kcrisman)

In 4.7.1:

sage: polar_plot(1/sin(1.001*theta),(theta, pi/12,pi/2))

Downloads/sage-4.7.1/local/lib/python2.6/site-packages/matplotlib/backends/backend_agg.pyc in print_png(self, filename_or_obj, *args, **kwargs)
    443             filename_or_obj = file(filename_or_obj, 'wb')
    444         _png.write_png(renderer._renderer.buffer_rgba(0, 0),
    445                        renderer.width, renderer.height,
--> 446                        filename_or_obj, self.figure.dpi)
    447         renderer.dpi = original_dpi

RuntimeError: Error building image

but this works

sage: polar_plot(1/sin(1.01*theta),(theta, pi/12,pi/2))

though it looks terrible, see attached pictures.

This no longer causes an error in 4.7.2, but the picture is still terrible.

Hat tip to Bill Page at this ask.sagemath.org question for noticing the error.

Attachments (2)

tinyaxispolarplot.png (3.4 KB) - added by kcrisman 10 years ago.
tinyaxispolarplot2.png (4.6 KB) - added by kcrisman 10 years ago.

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by kcrisman

Changed 10 years ago by kcrisman

comment:1 Changed 10 years ago by kcrisman

My guess is the automatic aspect ratio 1 is the problem, but that's just a guess.

comment:2 follow-up: Changed 10 years ago by jason

For polar plots, it makes sense a lot of times to have aspect_ratio=1. You want circles to look like circles, roses to look like roses, etc.

comment:3 in reply to: ↑ 2 Changed 10 years ago by kcrisman

For polar plots, it makes sense a lot of times to have aspect_ratio=1. You want circles to look like circles, roses to look like roses, etc.

Totes! I just meant that I suspect this is causing it, so we'd have to do some kind of workaround.

Actually, the "right" answer is to not allow such crazy axis behavior where the labels squash each other - maybe some kind of minimum figsize that keeps them looking ok - but I don't know if that would be easy to do at all.

comment:4 Changed 10 years ago by jdemeyer

  • Milestone sage-4.7.3 deleted

Milestone sage-4.7.3 deleted

comment:5 Changed 10 years ago by kcrisman

  • Description modified (diff)
  • Milestone set to sage-4.8

Any ideas how to rename the summary of this ticket? I do feel like we shouldn't return quite that skinny of a plot in terms of crushed labels... or Jason, do you feel like this should be closed since there isn't an error in 4.7.2?

comment:6 Changed 10 years ago by jason

  • Priority changed from major to minor
  • Summary changed from Polar plot with short axis leads to error to Polar plot with short axis has overlapping labels

Well, the picture is certainly ugly, so let's fix it. I'll put it as minor, though.

comment:7 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:8 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:9 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:10 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.