Ticket #4898 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Add style and labels to contour_plot()

Reported by: abergeron Owned by: abergeron
Priority: major Milestone: sage-4.2.1
Component: graphics Keywords:
Cc: wcauchois, jason Work issues:
Report Upstream: Reviewers: Jason Grout
Authors: Arnaud Bergeron, Karl-Dieter Crisman Merged in: sage-4.2.1.rc0
Dependencies: Stopgaps:

Description

This patch add the option of styling lines, either individually or all at once, and adding contour level labels.

Another one is coming to support this in combination with #2770.

Attachments

trac_4898.patch Download (14.4 KB) - added by abergeron 4 years ago.
trac_4898-contour-labels-rebase.2.patch Download (25.7 KB) - added by kcrisman 4 years ago.
Based on 4.1.2.rc1.alpha3
trac_4898-contour-labels-rebase.patch Download (13.1 KB) - added by kcrisman 4 years ago.
Based on 4.2 - apply only this!
trac-4898-reviewer.patch Download (4.4 KB) - added by jason 4 years ago.
apply on top of previous patch

Change History

comment:1 Changed 4 years ago by abergeron

  • Summary changed from [with patch; needs review] Add style and labels to contour_plot() to [with patch; don't review yet] Add style and labels to contour_plot()

I think it would just be better to wait until #2770 and #4884 are merged since they conflict with this. I'll post an updated patch then.

Changed 4 years ago by abergeron

comment:2 Changed 4 years ago by abergeron

  • Status changed from new to assigned
  • Summary changed from [with patch; don't review yet] Add style and labels to contour_plot() to [with patch; needs review] Add style and labels to contour_plot()

Update patch is posted. Start reviewing!

comment:3 Changed 4 years ago by jason

What was this updated to? I get conflicts applying it to 3.3alpha3.

comment:4 Changed 4 years ago by jason

  • Summary changed from [with patch; needs review] Add style and labels to contour_plot() to [with patch; needs rebase] Add style and labels to contour_plot()

I tried applying it to 3.3rc0:

jason@sage:~$ patch contour_plot.py < trac_4898.patch 
patching file contour_plot.py
Hunk #2 FAILED at 53.
Hunk #3 FAILED at 75.
Hunk #4 FAILED at 136.
Hunk #5 succeeded at 167 (offset -1 lines).
Hunk #6 succeeded at 180 (offset -1 lines).
Hunk #7 FAILED at 226.
Hunk #8 succeeded at 272 (offset -2 lines).
Hunk #9 succeeded at 293 (offset -2 lines).
Hunk #10 succeeded at 308 (offset -2 lines).
Hunk #11 succeeded at 317 (offset -2 lines).
Hunk #12 succeeded at 345 (offset -2 lines).
4 out of 12 hunks FAILED -- saving rejects to file contour_plot.py.rej

comment:5 Changed 4 years ago by jason

  • Cc wcauchois added

abergeron: what is the status of your work on this patch (and how can we help?) It looks like it is very useful. Thanks for doing this!

comment:6 Changed 4 years ago by abergeron

It is on my TODO list (which is rather long) and which I started attacking since the end of my finals.

I don't have a recent version of Sage on my machine right now so it'll be a couple of days before I can rebase it.

If somebody else wants to do it in the meantime, that could help.

comment:7 Changed 4 years ago by kcrisman

  • Cc jason added
  • Summary changed from [with patch; needs rebase] Add style and labels to contour_plot() to [with patch, needs review] Add style and labels to contour_plot()
  • Authors set to Arnaud Bergeron, Karl-Dieter Crisman

Here is a somewhat significant rebase based on 4.1.2.alpha2, also more or less ReSTified. There have been some definite changes in this file and matplotlib since then, so a few things now behave slightly differently from the original patch; however, I think they are just different, not wrong (especially when it comes to axes). In particular I hope I got the option popping in the right spots.

Great thanks to Arnaud's work here - especially labeling contours is a great thing to have now!

comment:8 Changed 4 years ago by jason

  • Status changed from needs_review to needs_work
  • Work issues set to rebase
  • Summary changed from [with patch, needs review] Add style and labels to contour_plot() to Add style and labels to contour_plot()

Unfortunately, it still needs more rebasing. Here is the result of applying it to 4.1.2.rc0:

jason@sage:~/sage-4.1.2.rc0-sage.math.washington.edu-x86_64-Linux/devel/sage/sage$ hg qpush
applying trac_4898-contour-labels-rebase.patch
patching file sage/plot/contour_plot.py
Hunk #11 succeeded at 517 with fuzz 1 (offset 3 lines).
Hunk #12 FAILED at 549
1 out of 12 hunks FAILED -- saving rejects to file sage/plot/contour_plot.py.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
Errors during apply, please fix and refresh trac_4898-contour-labels-rebase.patch

I'm excited for this to get in!

Changed 4 years ago by kcrisman

Based on 4.1.2.rc1.alpha3

comment:9 Changed 4 years ago by kcrisman

  • Status changed from needs_work to needs_review

Hmm, I had intended to delete the previous version...

Anyway, there was a one-character (in fact, one space) thing that prevented it from applying. So silly. It should actually apply to rc0 as well, I suspect, but you never know... anyway, can you check that if the only issue is a space, that you fix it manually to at least see if doctests pass?

Changed 4 years ago by kcrisman

Based on 4.2 - apply only this!

comment:10 Changed 4 years ago by jason

  • Status changed from needs_review to positive_review

I tweaked two of the defaults and add a bit more documentation. This is great; I'm excited to see this go in!

comment:11 Changed 4 years ago by jason

  • Reviewers set to Jason Grout
  • Work issues rebase deleted

Changed 4 years ago by jason

apply on top of previous patch

comment:12 Changed 4 years ago by mhansen

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.2.1.rc0

comment:13 Changed 4 years ago by mhansen

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