Customizing 3d plots

Greetings,

I'm trying to use Matplotlib to plot 3d surfaces, with
good results. While the plot are nice, there is little
information on the website about customizing them. To
get what I want, I used some tricks and hacks, and I am
pretty sure that there are better ways to do it. Here is
what I did, if you have any advice on how to do it better.

* The wireframe lines in the surface are thicker than I
  wanted. I couldn't find a way to configure their
  thickness. To get thinner lines, I made my plots huge
  (about 24 inches), and adjusted fonts accordingly. This
  is a very ugly (and unpredictable) hack.

* I need gray images, so I used the gray colormap. This,
  however, gave me very dark and bright areas, and I
  wanted a little less variation. Since my functions
  always range from 0. to 1., I set vmin=-1 and vmax=2.
  I got the result I wanted, but I feel that there is
  a better way to do that.

* The grids on the 'walls' and 'floor', on the other hand,
  are very bright, and I wanted them darker. Couldn't find
  a way to do that.

* In some plots, I don't want ticks on some axis. Setting
  ticks to [] gave me no result, and there is no method
  for that in the z-axis. Setting ticklabels to [] also
  made no difference. Is there a way to remove the ticks
  or the labels in 3d plots?

I figure out that there is probably ways to do all those
by handling the corresponding Artists, or other object of
the kind. But they are full of details, and I don't know
exactly where to start. Any directions will be appreciated.

I've been using matplotlib for years, and it is always
helpful, and the plots are always beautiful. Thanks for
the nice work.

···

---
José Alexandre Nalon
nalon@...166...

I apologize for the delay. I have not been paying attention to this mailing list for the past couple of months. My responses are below.

Greetings,

I’m trying to use Matplotlib to plot 3d surfaces, with

good results. While the plot are nice, there is little

information on the website about customizing them. To

get what I want, I used some tricks and hacks, and I am

pretty sure that there are better ways to do it. Here is

what I did, if you have any advice on how to do it better.

  • The wireframe lines in the surface are thicker than I

    wanted. I couldn’t find a way to configure their

    thickness. To get thinner lines, I made my plots huge

    (about 24 inches), and adjusted fonts accordingly. This

    is a very ugly (and unpredictable) hack.

That sounds like a decent feature request. Could you please file one at either sourceforge or github?

  • I need gray images, so I used the gray colormap. This,

    however, gave me very dark and bright areas, and I

    wanted a little less variation. Since my functions

    always range from 0. to 1., I set vmin=-1 and vmax=2.

    I got the result I wanted, but I feel that there is

    a better way to do that.

This is more of an issue regarding colormap norms. You might want to read up on them here:

http://matplotlib.sourceforge.net/api/colors_api.html?highlight=colormap%20norm#matplotlib.colors.Normalize

  • The grids on the ‘walls’ and ‘floor’, on the other hand,

    are very bright, and I wanted them darker. Couldn’t find

    a way to do that.

Not currently. These are hard-coded. I am hoping to have that and other things configurable in the next release of mpl.

  • In some plots, I don’t want ticks on some axis. Setting

    ticks to gave me no result, and there is no method

    for that in the z-axis. Setting ticklabels to also

    made no difference. Is there a way to remove the ticks

    or the labels in 3d plots?

Are you talking about the ticks, or the labels for the tick locations? Note that in 2d plots you can have ticks without labels, or labels without ticks. Currently in mplot3d, this is not very neat, and it is one thing I want to have cleaned up for the next release.

I figure out that there is probably ways to do all those

by handling the corresponding Artists, or other object of

the kind. But they are full of details, and I don’t know

exactly where to start. Any directions will be appreciated.

I’ve been using matplotlib for years, and it is always

helpful, and the plots are always beautiful. Thanks for

the nice work.

Thanks for using matplotlib!
Ben Root

···

On Wed, Apr 20, 2011 at 12:20 AM, José Alexandre Nalon <nalon@…1836…66…> wrote: