Hi everybody.
I have been trying to turn off xticks and yticks and their labels in
matplotlibrc.
[Ticks](http://matplotlib.sourceforge.net/api/axis_api.html#matplotlib.axis.Tick)
have an argument "tick1On" and "label1On" but it seems I can not use
these
in the config file. Is that correct?
Is there any other way to turn of ticks by default?
Thanks,
Andy
Hi Andy,
I don’t think there are any rc parameters for controlling this, but you can call plt.axis('off')
or ax.set_axis_off()
. I know that’s not what you were looking for, but I thought I’d mention it.
Best,
-Tony
···
On Mon, May 21, 2012 at 4:01 PM, Andreas Mueller <amueller@…4089…> wrote:
Hi everybody.
I have been trying to turn off xticks and yticks and their labels in
matplotlibrc.
[Ticks](http://matplotlib.sourceforge.net/api/axis_api.html#matplotlib.axis.Tick)
have an argument "tick1On" and "label1On" but it seems I can not use
these
in the config file. Is that correct?
Is there any other way to turn of ticks by default?
Thanks,
Andy
Gurus,
Windows XP, matplotlib 1.1.0. Backend Tk, but the same elsewhere.
Programme:
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['lines.linewidth'] = 2
mpl.rcParams['lines.color'] = 'r'
x=range(800)
y=[t for t in x]
plt.plot(x,y)
plt.show()
# ==============================
Linewidth OK, equal to 2, but the line is still blue. Changing "r" to red, or to #ff0000, or (1,0,0) doesn't change anything, still blue. Changing directly the matplotlibrc file (default) - the same. Leaving in peace the defaults, constructing another rc in the working dir - the same. The dictionary rcParams contains the correct value
'lines.color': 'r'
(Anyway, rcsetup.py validation doesn't protest. But then, the modified colour is ignored).
Somebody could confirm that?
The best.
Jerzy Karczmarczuk
Caen, France
Plot() doesn’t use lines.color. I don’t remember the exact name, but it uses an rcparam for color cycling. Just change make the list of colors be just ‘r’.
Ben Root
···
On Thursday, May 24, 2012, Jerzy Karczmarczuk wrote:
Gurus,
Windows XP, matplotlib 1.1.0. Backend Tk, but the same elsewhere.
Programme:
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams[‘lines.linewidth’] = 2
mpl.rcParams[‘lines.color’] = ‘r’
x=range(800)
y=[t for t in x]
plt.plot(x,y)
plt.show()
==============================
Linewidth OK, equal to 2, but the line is still blue. Changing “r” to
red, or to #ff0000, or (1,0,0) doesn’t change anything, still blue.
Changing directly the matplotlibrc file (default) - the same. Leaving in
peace the defaults, constructing another rc in the working dir - the
same. The dictionary rcParams contains the correct value
‘lines.color’: ‘r’
(Anyway, rcsetup.py validation doesn’t protest. But then, the modified
colour is ignored).
Somebody could confirm that?
The best.
Jerzy Karczmarczuk
Caen, France
I wrote:
mpl.rcParams[‘lines.color’] = ‘r’
...
...the line is still blue.
BR answers:
Plot() doesn't use lines.color. I don't remember the exact
name, but it uses an rcparam for color cycling. Just change
make the list of colors be just ‘r’.
[!#!!%!!]
Of course I found that myself some time after reporting this
“bug”… Sorry.
The parameter is "axes.color_cycle"
Jerzy K.