Matplotlib - why scatter plot markers are stretched?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Matplotlib - why scatter plot markers are stretched?

Gopi1616
I was creating scatter plot using matplotlib with python2.7 script and it
worked totally fine. I then upgraded my python script from python2.7 to 3.6
now and the markers in the plot are stretched, not sure why this is
happening. Please help me with this.
<http://matplotlib.1069221.n5.nabble.com/file/t5171/comparison.png>

Data:
    table1.index   freq_table1['VarFreq']
                   1    0.2
                   2    0.4
                   3    0.7
                   4    1.0

Code:
        fig = plt.figure(figsize=(20,16))
        ax1 = fig.add_subplot(1,1,1)
        ax1.scatter(table1.index, table1['VarFreq'], color='r', label=VCF1_legend,
marker="*")
        ax1.scatter(table2.index, table2['VarFreq'], color='blue',
label=VCF2_legend, marker="+")
        plt.legend(loc='upper right')
        ax1.set_title('VarFreq correlation, fontsize=20)
        plt.savefig('WESPP_frequency_comparison.png', dpi=600 )



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Matplotlib - why scatter plot markers are stretched?

tcaswell
What is the data type of the the index?

Can you give us a copy-pasteble example (if we change your example to fill in the missing variables we may miss a key detail and not be able to reproduce the issue).  Generating random data is usually a good approach here.



On Thu, Jul 19, 2018 at 10:33 AM Gopi1616 <[hidden email]> wrote:
I was creating scatter plot using matplotlib with python2.7 script and it
worked totally fine. I then upgraded my python script from python2.7 to 3.6
now and the markers in the plot are stretched, not sure why this is
happening. Please help me with this.
<http://matplotlib.1069221.n5.nabble.com/file/t5171/comparison.png>

Data:
    table1.index   freq_table1['VarFreq']
                   1    0.2
                   2    0.4
                   3    0.7
                   4    1.0

Code:
        fig = plt.figure(figsize=(20,16))
        ax1 = fig.add_subplot(1,1,1)
        ax1.scatter(table1.index, table1['VarFreq'], color='r', label=VCF1_legend,
marker="*")
        ax1.scatter(table2.index, table2['VarFreq'], color='blue',
label=VCF2_legend, marker="+")
        plt.legend(loc='upper right')
        ax1.set_title('VarFreq correlation, fontsize=20)
        plt.savefig('WESPP_frequency_comparison.png', dpi=600 )



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


--
Thomas Caswell
[hidden email]

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users