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

How to modify a Contour once it has been put into a Graph? #2669

Open
regislebrun opened this issue May 30, 2024 · 4 comments
Open

How to modify a Contour once it has been put into a Graph? #2669

regislebrun opened this issue May 30, 2024 · 4 comments
Labels

Comments

@regislebrun
Copy link
Member

regislebrun commented May 30, 2024

What happened?

If I want to modify the colorbar location of a Contour once it has been put into a Graph, I don't have access to the Contour interface but only the interface of Drawable:

import openturns as ot

g = ot.Normal(2).drawPDF()
contour = g.getDrawable(0)
# Impossible to change the colorbar location
contour.setColorBarPosition("") # fails

How to reproduce the issue?

Use the given script

Version

1.24dev

Operating System

all

Installation media

from source

Additional Context

No response

@josephmure
Copy link
Collaborator

You can do it this way;

import openturns as ot

g = ot.Normal(2).drawPDF()
contour = g.getDrawable(0).getImplementation()
contour.setColorBarPosition("")

@josephmure josephmure added question and removed bug labels Jun 5, 2024
@mbaudin47
Copy link
Collaborator

@regislebrun : I suggest to update the title to "How to remove the colorbar of a contour plot?". I also suggest to close this issue, since the answer was given by @josephmure

@regislebrun
Copy link
Member Author

@mbaudin47: The problem is not bound to the colorbar location but for all the methods of Contour not accessible from the Drawable interface. BTW many of these methods are poorly documented, such as isVminUsed()/isVmaxUsed(). It is stated that they are accessors to the related flag, but one has no clue on why it is usefull to get this information, in particular we don't know for what this value is used.

@josephmure
Copy link
Collaborator

Vmin and vmax are documented in https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html so I guess the answer is to link to this page.

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

No branches or pull requests

3 participants