Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying log with arbitrary base #4311

Closed
goyalyashpal opened this issue Aug 16, 2022 · 8 comments
Closed

Specifying log with arbitrary base #4311

goyalyashpal opened this issue Aug 16, 2022 · 8 comments

Comments

@goyalyashpal
Copy link

goyalyashpal commented Aug 16, 2022

  • with reference to the documentation for supported attributes for scale at https://docs.juliaplots.org/latest/generated/supported/#Scales
  • the scales of log with common base : ln , log10 , log2 are listed in there (the default gr backend doesnt support base 2, e as can be seen in the attached image)
  • if the approach was allowing general base for log scales, then that would allow for much for flexibility while filling in the current void of capabilities

e.g. from python : matplotlib.pyplot :

plt.semilogy( y, base = 2 )

image

Originally posted by @yashpalgoyal1304 in #74 (comment)

@mkborregaard
Copy link
Member

mkborregaard commented Aug 16, 2022

The implementation reason for this is that the scale argument to Plots may be many different things, not just a log scale.
More to the point, though, what would be the use case for this? Log scale of all integer bases are all the same transformation in terms of relative point positions, so it's just a question what to put on the tick marks.

"the current void of capabilities" is maybe a bit dramatic :-D

@t-bltg t-bltg added the extension new behaviour label Aug 16, 2022
@goyalyashpal
Copy link
Author

goyalyashpal commented Aug 16, 2022

scale argument to Plots may be many different things, not just a log scale

i know, i have even already attached the screenshot of it. but there has to be some way to specify the base in case of log, or say power in case of extension of sqrt (if that ever comes on the plan lol)

it's just a question what to put on the tick marks

tick marks and grid - yeah, so, how can i do that?

"the current void of capabilities" is maybe a bit dramatic :-D

yeah, i agree 😅 , but it is kinda essential for analysis - like say, u are dealing with something where the output which come to say powers of 7 is important. so, keeping track of that (i.e. both the tick marks and grid) becomes essential

@t-bltg
Copy link
Member

t-bltg commented Aug 17, 2022

but it is kinda essential for analysis - like say, u are dealing with something where the output which come to say powers of 7 is important. so, keeping track of that

If you known your maths, you should be able to transform your data before plotting.
It would be difficult to support other / arbitrary scales for all backends, without increasing code complexity, and for little gain.

the scales of log with common base : ln , log10 , log2 are listed in there (the default gr backend doesnt support base 2, e as can be seen in the attached image

As you pointed out scaling is (most of the time) a feature of a specific backend (lower level than Plots.jl), so this mean we probably can't do anything here in the intermediate / high level Plots layer. If it is missing in gr, I'd say it should be requested in gr, not Plots.

@goyalyashpal goyalyashpal closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2022
@goyalyashpal
Copy link
Author

goyalyashpal commented Aug 17, 2022

If you known your maths, you should be able to transform your data before plotting.

that's not a good suggestion at all... going by that, even the log scaling can be done before plotting, but the option to plot on log scale/log graph exist and that's for a reason... but anyways, thanks for the input.

@t-bltg
Copy link
Member

t-bltg commented Aug 17, 2022

Yes, this is to say that log scaling is a convenience provided by Plots, not a necessity. Sorry, maybe the wording was too harsh, but I wanted to point out that nothing prevented you from transforming your data before plotting, achieving the end result.

@goyalyashpal
Copy link
Author

just for the records, the problem with that approach is that log scaling doesnt work directly/inline with 2D arrays (i.e. when an array has multiple "series" to be plotted) whereas with scaling it works direct:

# Doesn't work on whole list, works only per index
plot( log.( list[ i ] ) )
plot( list, scale = :log )

@goyalyashpal
Copy link
Author

goyalyashpal commented Oct 11, 2022 via email

@goyalyashpal
Copy link
Author

aah, this is painful - what happened 5 days ago, this is third instance of some old email resent "5 days ago"

please help me in this misterious auto resending of emails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants