Ticks at fixed locations with uneven interval

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Ticks at fixed locations with uneven interval

erzdemir
I would like to keep ticks at locations evenly spaced but keep their values
uneven. Is it possible to do it in matplotlib.



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Ticks at fixed locations with uneven interval

Paul Hobson-2
You could do this as categorical (string) variables.

Otherwise you might need to write your own scale.
-Paul

On Sun, Sep 10, 2017 at 12:20 AM, erzdemir <[hidden email]> wrote:
I would like to keep ticks at locations evenly spaced but keep their values
uneven. Is it possible to do it in matplotlib.



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Ticks at fixed locations with uneven interval

Benjamin Root
The tick labels and the tick locations are two separate things (but often conflated). By default, the tick label is the string representation of its location, but it doesn't have to be that. You can call `ax.set_xticklabels(['1', '20', '-5', 'foo'])`, assuming you know the number of ticks that will appear.

Cheers!
Ben Root


On Sun, Sep 10, 2017 at 11:38 AM, Paul Hobson <[hidden email]> wrote:
You could do this as categorical (string) variables.

Otherwise you might need to write your own scale.
-Paul

On Sun, Sep 10, 2017 at 12:20 AM, erzdemir <[hidden email]> wrote:
I would like to keep ticks at locations evenly spaced but keep their values
uneven. Is it possible to do it in matplotlib.



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users