question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scale_y_reverse and transformations does not reverse

See original GitHub issue

Example

from plotnine import *
import pandas as pd

df = pd.DataFrame({
   'p': [0.1, 0.2, 0.3, 0.4, 0.5],
   'c': ['red','blue','lightblue','purple','green'],
   'x': ['x'] * 5
   
})
g = ggplot(df)
g += geom_point(aes('x','p', color='c'))
g += scale_color_identity()
g += scale_y_reverse(trans='log10')
g += ggtitle('scale_y_reverse')
g

image

Looks identical to scale_y_continuous: image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
has2k1commented, Jan 30, 2019

Solution is

+ coord_trans(y='reverse')
0reactions
has2k1commented, Feb 1, 2019

The ggplot documentation has an unfortunate statement "Transformations only work with continuous values: "

It is an implementation detail, but one that may not change for a long time; by the time the coordinate transformations take place all values being being transformed are numeric. So you can probably apply any transform on “discrete” axes but they may not make much sense except for the reverse transform.

Read more comments on GitHub >

github_iconTop Results From Across the Web

R: how to simultaneously reverse and apply transformation to ...
Applying the transformations one by one (i.e. +scale_y_reverse() ... + scale_y_log() ) gives a warning: Scale for 'y' is already present. Adding ...
Read more >
Reverse transformations - IBM
You can use reverse transformations to recover changes to the model or recover changes to source code. This process is useful when the...
Read more >
Is it possible to reverse race transformation? : r/dndnext - Reddit
But there are no official rules for permanently altering a character's race (save for the Reincarnation spell), so there are none for reversing...
Read more >
How To Reverse Axis Order And Use A Predefined Scale In ...
always start by calling the ggplot function. then specify the data object. It has to be a data frame. And it needs one...
Read more >
Efficient Dual-Numbers Reverse AD via Well-Known Program ...
Indeed, reverse AD promises to compute the gradient of a ... The program transformation does not care what the contents of Op ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found