Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add colorbar option to contour_plots #8368

Closed
jasongrout opened this issue Feb 25, 2010 · 13 comments
Closed

add colorbar option to contour_plots #8368

jasongrout opened this issue Feb 25, 2010 · 13 comments

Comments

@jasongrout
Copy link
Member

This patch adds the option of creating a color bar on a filled contour plot. See the doctests in the patch for examples.

CC: @kcrisman @sagetrac-wcauchois @robert-marik

Component: graphics

Author: Jason Grout

Reviewer: Robert Mařík

Merged: sage-4.4.alpha2

Issue created by migration from https://trac.sagemath.org/ticket/8368

@jasongrout
Copy link
Member Author

comment:1

This ticket depends on #8366.

@jasongrout
Copy link
Member Author

comment:2

(update makes colorbars work even when fill=False)

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Apr 4, 2010

comment:4

One thing I don't like about this is that you can't easily get a 1:1 aspect ratio plot - using figsize = [a,a] makes the overall figure square but not the plotted region.

@jasongrout
Copy link
Member Author

comment:5

Replying to @sagetrac-mhampton:

One thing I don't like about this is that you can't easily get a 1:1 aspect ratio plot - using figsize = [a,a] makes the overall figure square but not the plotted region.

Of course. If you want the aspect ratio to be 1, then use the aspect_ratio=1 argument, which controls the aspect ratio. The figsize option controls the "figure size", i.e., the size of the entire figure.

@jasongrout
Copy link
Member Author

apply instead of previous patch (rebased for the new #8366)

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Apr 15, 2010

comment:6

Attachment: trac-8368-colorbars.patch.gz

Replying to @jasongrout:

Replying to @sagetrac-mhampton:

One thing I don't like about this is that you can't easily get a 1:1 aspect ratio plot - using figsize = [a,a] makes the overall figure square but not the plotted region.

Of course. If you want the aspect ratio to be 1, then use the aspect_ratio=1 argument, which controls the aspect ratio. The figsize option controls the "figure size", i.e., the size of the entire figure.

OK. I think I got into the habit of using figsize before aspect_ratio worked. I will check the rebased version as soon as I can.

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Apr 16, 2010

comment:7

Thanks for rebasing, I got the following errors. (But I do not switch the 'needs_review' flag unless somebody confirms this issue.)

...
      File "/mnt/usb1/scratch/marik/sage-4.3.5-sage.math.washington.edu-x86_64-Linux/local/lib/python/site-packages/sage/plot/contour_plot.py", line 193, in _render_on_subplot
        if options['colorbar']:
    KeyError: 'colorbar'
**********************************************************************
...
----------------------------------------------------------------------
The following tests failed:

        sage -t  "devel/sage/sage/plot/contour_plot.py"
Total time for all tests: 25.0 seconds

It would be also nice to add :: in between each pair of different examples - this allows to run any of the examples provided in this patch immediately from reference guide.
Robert

@jasongrout
Copy link
Member Author

apply on top of previous patch

@jasongrout
Copy link
Member Author

comment:8

Attachment: trac-8368-fix-options.patch.gz

I fixed both issues in the above patch.

I also doctested contour_plot.py this time!  Things should work now.

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Apr 21, 2010

Reviewer: Robert Mařík

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Apr 21, 2010

comment:9

Installs fine, works as excpected, tests passed now, documentation builds fine, positive review and thanks for adding this feature, as well as including my comments.

Positive review.

Release manager: Apply both trac-8368-colorbars.patch and trac-8368-fix-options.patch patches.

@jhpalmieri
Copy link
Member

comment:10

Merged into 4.4.alpha2:

  • trac-8368-colorbars.patch
  • trac-8368-fix-options.patch

@jhpalmieri
Copy link
Member

Merged: sage-4.4.alpha2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants