-
Notifications
You must be signed in to change notification settings - Fork 54
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
setcolorrep seems to set the wrong colors? #64
Comments
this is on os x |
What type of output are you using? GKSTerm? What does your output look like? For me the following program yields red, green and blue lines:
The values returned by
With |
hm. i am using gksterm and i get the same as you for your example program. no idea why i got something else before. i will try to reproduce my problem... |
hm. i get the right colors now. i think it might have to do with the order of gr.setviewport (creating a window) and gr.setcolorrep? do i have to initialize before tinkering with the colors? |
i found a case where it does not appear to work correctly.
|
i guess i don't understand in what order the colors in the colormap are used?! |
would it be easier to just switch to matplotlib with gr backend? |
This is not related to colormaps. The For example this code:
will produce the following output: Alternatively, you could achieve the same output using mlab.oplot and setting the color for each part of the plot:
|
ah ok, sorry for the noise. mlab is just replicating the api of matlab/pylab. i thought the standard color sequence must be the first ones in the colormap -- wrong! |
hm, i think i'm almost there but am still getting results that are a bit off, for instance wrong frame color etc.
i then call |
Yes, this should work. There might be a
Could you post a minimal working example that results in a wrongly colored frame? |
ok, this is confusing. if i run your example without calling apply_colors, i the the same result i posted above?! |
So you get an orange frame when calling this code?
Have you kept GKSTerm running continuously since you've tried setting colors including color 1? If so, the color might still be set to whatever you set it to (apparently orange/peach). Try running |
ah, ok. i did run exactly your just posted code. i quite ipython before doing that but in fact GKSTerm was not killed. so now i manually killed GKSTerm, restarted ipython and ran the code. i now get a black frame and the standard colors. finally, i did the same including killing GKSTerm with your original code. now i get your result. in conclusion: i did not account for the fact that GKSTerm keeps global state even when the window is closed. when killin GKSTerm each time, everything works as expected. side note: is this the desired behavior of GKSTerm? apparently it's not a child process of the python session that imports gr, otherwise it should not survive ending the ipython session... |
hi, i fear i am not understanding something. i try this:
where
upd
is the update function called in the animation loop, andn1, n2, n3
are changing buffers. this works, but the colors are not red green and blue as i would have expected from the docs?The text was updated successfully, but these errors were encountered: