plot margins

8 views
Skip to first unread message

Joel B. Mohler

unread,
Oct 18, 2007, 4:09:04 PM10/18/07
to sage-...@googlegroups.com
A couple of days ago I wrote to sage-support complaining about margins on plots
-- I think they are too big. Ironically, it seems that vanilla matplotlib is
even worse for this in some respects, but sage does a couple of funny things
that I'd like a plotting guru to look at. It seems there is a couple of rather
arbitrary adjustments to min/max parameters. I think that each one of these
adjustments should be reconsidered. I attached a patch file which fixes my most
immediate gripes -- I don't necessarily mean it as a patch to go upstream yet,
but to generate discussion with the relevant person (Alex Clemesha?) to come up
with a correct fix.

(Warning: Slight rant ahead) I agree that the results might be pleasing to the
eye when you are just throwing up a quick graph on screen, but I abhor arbitrary
adjustments when I'm trying to make publication quality .eps files. For myself,
the publication quality graphics is the dominant use of a CAS plotting ability.
Therefore, I think this needs to be very well supported mode. In this case, you
are probably using latex and latex makes it's own margin around a figure. To
make an extra margin messes with the all-knowing-wisdom of latex. I'm probably
preaching to the choir in this paragraph, but I've been seriously aggravated at
every graphics engine I've used on similar points to these. I'm hoping sage
will be my panacea -- and it's looking likely!

--
Joel

Joel B. Mohler

unread,
Oct 18, 2007, 4:19:01 PM10/18/07
to sage-...@googlegroups.com
Oops, forget the patch! Now it is attached.
excess_margin_removal.patch

alex clemesha

unread,
Oct 18, 2007, 5:00:13 PM10/18/07
to sage-...@googlegroups.com
On 10/18/07, Joel B. Mohler <jo...@kiwistrawberry.us> wrote:

A couple of days ago I wrote to sage-support complaining about margins on plots
-- I think they are too big.  Ironically, it seems that vanilla matplotlib is
even worse for this in some respects, but sage does a couple of funny things
that I'd like a plotting guru to look at.  It seems there is a couple of rather
arbitrary adjustments to min/max parameters. 

Yes, it is true that they are arbitrary in the sense that maybe tweaking
them a little this way or that might  give  'better' results in certain cases,
but they are there as a result of a lot of 'testing' (read: making tons of plots)
and taking the best values that 'in most cases' gives visually useful and
good looking plots.
 

 I think that each one of these
adjustments should be reconsidered.  I attached a patch file which fixes my most
immediate gripes -- I don't necessarily mean it as a patch to go upstream yet,
but to generate discussion with the relevant person (Alex Clemesha?) to come up
with a correct fix.

Thanks for bringing this up and working on it ...  so maybe the best possible way to
'fix' this problem is to expose everything single possible parameter
to the user (with given defaults of course), and then in most cases
plots would look nice, but for making very exact plots, a user
has the option to do a lot of tweaking.


(Warning: Slight rant ahead) I agree that the results might be pleasing to the
eye when you are just throwing up a quick graph on screen, but I abhor arbitrary
adjustments when I'm trying to make publication quality .eps files. 

Agreed.

 For myself,
the publication quality graphics is the dominant use of a CAS plotting ability.
Therefore, I think this needs to be very well supported mode.  In this case, you
are probably using latex and latex makes it's own margin around a figure.  To
make an extra margin messes with the all-knowing-wisdom of latex.  I'm probably
preaching to the choir in this paragraph, but I've been seriously aggravated at
every graphics engine I've used on similar points to these.  I'm hoping sage
will be my panacea -- and it's looking likely!

I'm considering doing a semi-major clean up of the
plotting functionality so please jot down improvements
that you (or anyone) think could be made.

Alex

--
Joel

cwitty

unread,
Oct 18, 2007, 5:48:30 PM10/18/07
to sage-devel
On Oct 18, 2:00 pm, "alex clemesha" <cleme...@gmail.com> wrote:
> I'm considering doing a semi-major clean up of the
> plotting functionality so please jot down improvements
> that you (or anyone) think could be made.

See TRAC #924 for a bug-fix I would like. (I reported this in person
at SD4, but I guess we all forgot about it until your message reminded
me.)

Carl

Joel B. Mohler

unread,
Oct 18, 2007, 6:08:43 PM10/18/07
to sage-...@googlegroups.com
On Thursday 18 October 2007 17:00, alex clemesha wrote:
> > A couple of days ago I wrote to sage-support complaining about margins on
> > plots
> > -- I think they are too big.  Ironically, it seems that vanilla
> > matplotlib is
> > even worse for this in some respects, but sage does a couple of funny
> > things
> > that I'd like a plotting guru to look at.  It seems there is a couple of
> > rather
> > arbitrary adjustments to min/max parameters.
>
> Yes, it is true that they are arbitrary in the sense that maybe tweaking
> them a little this way or that might  give  'better' results in certain
> cases,
> but they are there as a result of a lot of 'testing' (read: making tons of
> plots)
> and taking the best values that 'in most cases' gives visually useful and
> good looking plots.

Ok, I wasn't sure how much of this was thought about and how much was "oh, it
looks good to me" kind of decisions. I think the thing that really put me
off about it was that I had to change two different places in the source to
get rid of these extra margins and then there were a few other places that
looked like they might need changing if I wanted to get rid of the margins
for other styles of plotting. It seemed like all that should be a bit more
unified.

Aside from making the code look more complicated, this spreading out of the
margin logic might make exposing options to the user very nasty.

I'm in the midst of remaking some graphics that I made in mathematica about 5
years ago. Sage goes much better for this as a "real" programming
environment (for my own wildly biased value of "real"). I'll try and
document all the gotcha's I find.

--
Joel


--
Joel

Reply all
Reply to author
Forward
0 new messages