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

Isoline plot results seem odd in cdat81 #203

Open
LDuan3008 opened this issue Jul 12, 2019 · 9 comments
Open

Isoline plot results seem odd in cdat81 #203

LDuan3008 opened this issue Jul 12, 2019 · 9 comments

Comments

@LDuan3008
Copy link

Dear all,

I just re-installed the new cdat81. And I use the same script to draw a contour plot.

The results seem odd and there are large dark space appear.

Also, using the new cdat81 introduces difference when using isofill.

See the attached plots for isoline and isofill. Codes for line plots are shown below.

(1) isoline plot
isoline

(2) new isofill plot when saving as postscript
Screen Shot 2019-07-12 at 8 57 28 AM

(3) new isofill plot when saving as pdf
Screen Shot 2019-07-12 at 8 58 55 AM

(4) line plot codes

v=vcs.init(); v.setcolormap('default')

l_asd = v.createisoline('quick')
l_asd.level = [(2, 3, 4, 5)]
l_asd.linecolors= ['black']
l_asd.label = 'y'
l_asd.text=None

v.isoline(test_data,l_asd)
v.postscript('test')
v.close()

@LDuan3008 LDuan3008 changed the title Isoline plot in cdat81 Isoline plot results seem odd in cdat81 Jul 12, 2019
@danlipsa
Copy link
Contributor

@starrystarrynightt Can you share the data you used to see this? Thanks!

@LDuan3008
Copy link
Author

Hi @danlipsa thanks for your responses.

The whole plotting script I used is attached here. "tmp1" is some 2D data:

import numpy as np
import vcs
import MV2 as MV

axis_shreshold = cdms.createAxis(np.arange(8))
axis_ramprate  = cdms.createAxis(np.arange(8))

tmp1 = #some 2D data
tmp2 = MV.array(tmp1)
tmp2.setAxis(1,axis_shreshold)
tmp2.setAxis(0,axis_ramprate)

v=vcs.init(); v.setcolormap('default')

r_asd = v.createisofill()
r_asd.levels = [-0.01,1,1.5,2,2.5,3,3.5,4,4.5,5,1e20]
r_asd.fillareacolors= (20,50,70,90,130,150,170,190,200,220)

l_asd = v.createisoline('new')
l_asd.level = [(2, 3, 4, 5)]
l_asd.linecolors= ['black']
l_asd.label = 'y'
l_asd.text=None

v.plot(tmp2,l_asd); v.postscript('shrerampcuml_GlobCI1'); v.close()

@danlipsa
Copy link
Contributor

@starrystarrynightt I cannot reproduce this with my data. Can you please attach the data you are using as well. Thanks.

@danlipsa
Copy link
Contributor

And complete the script so that I have a working script that I can run on my machine. Thanks!

@danlipsa
Copy link
Contributor

@doutriaux1 FYI

@LDuan3008
Copy link
Author

Dear @danlipsa

Sorry for responding late. Please find the data for map plot and line plot here: (https://github.com/starrystarrynightt/uploaded-data-and-scripts-for-uvcdat)

The issues still occur:
(1) for map plot, using ".pdf" or ".postscript" produce different images;
(2) for the line plot, there is a dark area produced.

I also uploaded figures I produced on my mac using this data and script.

Best,
Lei

@danlipsa
Copy link
Contributor

@starrystarrynightt Indeed, I can reproduce 1). I am not sure what 2 is. Can you upload a PNG where you point out what is the problem. Thanks

@LDuan3008
Copy link
Author

Hi @danlipsa , I have uploaded the figures in the same repository (https://github.com/starrystarrynightt/uploaded-data-and-scripts-for-uvcdat):

(1) line_data_pdf.pdf: line plot using vcs, isoline;
(2) line_matplotlibt: plot the same data using matplotlib.

Thanks.

@LDuan3008
Copy link
Author

Dear @danlipsa

I am wondering if there are any updates about this issue?

Thanks very much!

Best,
Lei

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

No branches or pull requests

2 participants