On Mon, Mar 7, 2011 at 10:01 AM, Muffles <dantares...@gmail.com> wrote:

>
> Hello, i am not a user of matplotlib, i just have to do something in it.
> I managed to get the plot i wanted, but i have been going around for hours
> trying to do some fine tuning and cant get around it. The matplotlib seems
> way too extense for me to find the solutions without studying it avidly,
> and
> i just dont have the time...
> But trust me, i've looked everywhere and tried everything...
>
> What i need to do is:
>  - Change the axes labeling (if its like 1 2 3 4 5 6 change it to A B C D
> for example)
>

You want set_xticklabels() (or set_yticklabels()):

http://matplotlib.sourceforge.net/api/axes_api.html?highlight=set_xticklabels#matplotlib.axes.Axes.set_xticklabels

Note that will not change the number of ticks already established for the
axis.  For that, you can use set_xticks(), which accepts a list of values
where to set the tick marks (you should probably use set_xticklabels() after
set_xticks()).  Note that you will need to have access to the axes object.
For example:


import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.gca()         # <--- the axes object I was talking about...
ax.scatter([], [])
ax.set_xticks([0.2, 0.4, 0.6, 0.8])
ax.set_xticklabels(['A', 'B', 'C', 'D'])
plt.show()



>  - Resize the window, not the plot (I have the figsize=(6,10) and thats
> fine
> for the plot, but the colorbar just gets cut in half, cant fit in the
> window)
>
>
Can you include a screenshot of what you see?


Ben Root
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to