Opened 9 years ago

Closed 9 years ago

#14074 closed defect (invalid)

saving fill in eps doesn't work right for some reason

Reported by: kcrisman Owned by: jason, was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords:
Cc: jason Merged in:
Authors: Reviewers: Punarbasu Purkayastha
Report Upstream: Reported upstream. Developers deny it's a bug. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

See this ask.sagemath.org question. The original poster points out that

(plot(1+e^(-x^2), xmin=-2, xmax=2, ymin=0, ymax=2.5, fill=0.5, fillcolor='green', fillalpha=0.5)).save('t.eps')

doesn't actually save with the correct fill. A simpler example is comparing

sage: polygon([(0,0), (1,1), (0,1)],alpha=.1).save('test.pdf')
sage: polygon([(0,0), (1,1), (0,1)],alpha=.1).save('test.eps')

Is this a Sage or matplotlib issue?

Change History (9)

comment:1 Changed 9 years ago by kcrisman

My thus far unsuccessful attempt. I always forget something when trying to use mpl natively, and this is no exception. I think I just need a week to memorize the mpl workflow.

sage: from matplotlib.figure import Figure
sage: figure = Figure()
sage: subplot = figure.add_subplot(111)
sage: import matplotlib.patches as patches
sage: p = patches.Polygon([(1, 2), (2, 3), (3, 2)])
sage: p.set_alpha(float(.1))
sage: p.set_fill(True)
sage: p.set_linewidth(float(10))
sage: p.set_edgecolor((float(0.25), float(0.4), float(0.9)))
sage: subplot.add_patch(p)
sage: from matplotlib.backends.backend_agg import FigureCanvasAgg
sage: figure.set_canvas(FigureCanvasAgg(figure))
sage: figure.savefig('test.png')

Unfortunately this doesn't work for some reason (empty plot other than frame). Maybe I added the plot too early.

comment:2 Changed 9 years ago by ppurka

It's a bug in mpl.

comment:3 Changed 9 years ago by ppurka

  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

Reported at upstream bug #1740.

comment:4 follow-up: Changed 9 years ago by kcrisman

And here is the response - that PostScript doesn't actually support this. Well, now what?

Last edited 9 years ago by kcrisman (previous) (diff)

comment:5 in reply to: ↑ 4 Changed 9 years ago by ppurka

Replying to kcrisman:

And here is the response - that PostScript doesn't actually support this. Well, now what?

It seems only some backends can make eps look like it supports transparency. So, now I would say that this ticket should be closed as "invalid". ;) If someone needs transparency with eps, then they should save it to some other format and then convert it to eps.

comment:6 Changed 9 years ago by ppurka

  • Report Upstream changed from Reported upstream. No feedback yet. to Reported upstream. Developers deny it's a bug.
  • Status changed from new to needs_review

Closing this ticket since it is not really a bug.

comment:7 Changed 9 years ago by ppurka

  • Milestone changed from sage-5.7 to sage-duplicate/invalid/wontfix
  • Status changed from needs_review to positive_review

Invalid.

comment:8 Changed 9 years ago by ppurka

  • Reviewers set to Punarbasu Purkayastha

comment:9 Changed 9 years ago by jdemeyer

  • Resolution set to invalid
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.